Whamcloud - gitweb
LU-1055 remove improper assert in osd_declare_object_destroy
authorNiu Yawei <niu@whamcloud.com>
Fri, 3 Feb 2012 07:44:24 +0000 (23:44 -0800)
committerOleg Drokin <green@whamcloud.com>
Tue, 14 Feb 2012 16:55:57 +0000 (11:55 -0500)
After recovery, orphan cleanup could race with the client unlink on
close, so the LASSERT on lu_object_is_dying() should be moved from
declare stage into the real destroy function.

Signed-off-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: Niu Yawei <niu@whamcloud.com>
Change-Id: Ibc4ad0613d907ab98b653d5a64ce54e1f018dcb2
Reviewed-on: http://review.whamcloud.com/2083
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/osd-ldiskfs/osd_handler.c

index 1098ae4..aedf8dd 100644 (file)
@@ -1996,7 +1996,6 @@ static int osd_declare_object_destroy(const struct lu_env *env,
         oh = container_of0(th, struct osd_thandle, ot_super);
         LASSERT(oh->ot_handle == NULL);
         LASSERT(inode);
         oh = container_of0(th, struct osd_thandle, ot_super);
         LASSERT(oh->ot_handle == NULL);
         LASSERT(inode);
-        LASSERT(!lu_object_is_dying(dt->do_lu.lo_header));
 
         OSD_DECLARE_OP(oh, destroy);
         OSD_DECLARE_OP(oh, delete);
 
         OSD_DECLARE_OP(oh, destroy);
         OSD_DECLARE_OP(oh, delete);
@@ -2024,6 +2023,7 @@ static int osd_object_destroy(const struct lu_env *env,
         oh = container_of0(th, struct osd_thandle, ot_super);
         LASSERT(oh->ot_handle);
         LASSERT(inode);
         oh = container_of0(th, struct osd_thandle, ot_super);
         LASSERT(oh->ot_handle);
         LASSERT(inode);
+        LASSERT(!lu_object_is_dying(dt->do_lu.lo_header));
 
         if (S_ISDIR(inode->i_mode)) {
                 LASSERT(osd_inode_unlinked(inode) ||
 
         if (S_ISDIR(inode->i_mode)) {
                 LASSERT(osd_inode_unlinked(inode) ||