Whamcloud - gitweb
LU-17075 osd: destroy declare shouldn't panic 96/52496/7
authorAlex Zhuravlev <bzzz@whamcloud.com>
Mon, 25 Sep 2023 10:11:04 +0000 (13:11 +0300)
committerOleg Drokin <green@whamcloud.com>
Sat, 18 Nov 2023 21:44:24 +0000 (21:44 +0000)
if the object doesn't exist during declaration.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Change-Id: I7d42cad0c04e7941a2f7950fdddaf7c473998b12
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52496
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
lustre/osd-zfs/osd_object.c

index b66254b..6ef58d7 100644 (file)
@@ -762,7 +762,8 @@ static int osd_declare_destroy(const struct lu_env *env, struct dt_object *dt,
        ENTRY;
 
        LASSERT(th != NULL);
-       LASSERT(dt_object_exists(dt));
+       if (unlikely(obj->oo_dn == NULL))
+               RETURN(-ENOENT);
 
        oh = container_of(th, struct osd_thandle, ot_super);
        LASSERT(oh->ot_tx != NULL);