Whamcloud - gitweb
LU-1534 osd: Fix LBUGs when destroying IGIF objects
authorLi Wei <liwei@whamcloud.com>
Sun, 17 Jun 2012 05:16:47 +0000 (13:16 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Wed, 20 Jun 2012 04:53:14 +0000 (00:53 -0400)
When destroying MDT objects with IGIF FIDs, the following assertion
may occur:

  LustreError: 28147:0:(osd_internal.h:665:osd_fid2oi()) ASSERTION(
  !fid_is_igif(fid) ) failed:
  LustreError: 28147:0:(osd_internal.h:665:osd_fid2oi()) LBUG
  Pid: 28147, comm: mdt_00

With call traces like this:

  osd_oi_delete()
  osd_object_destroy()
  mdd_object_kill()
  mdd_finish_unlink()
  mdd_unlink()

This patch fixes osd_oi_delete() to avoid trying to delete IGIF FIDs
from OI.  Also, the assertion is enhanced to print more debugging
information.

Signed-off-by: Li Wei <liwei@whamcloud.com>
Change-Id: I95fe9db8aec53a496a8dc84c87594ed81f3fe106
Signed-off-by: Li Wei <liwei@whamcloud.com>
Reviewed-on: http://review.whamcloud.com/3120
Reviewed-by: Fan Yong <yong.fan@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
lustre/osd-ldiskfs/osd_internal.h
lustre/osd-ldiskfs/osd_oi.c

index f75bb7e..307ecfa 100644 (file)
@@ -661,11 +661,11 @@ static inline int osd_oi_fid2idx(struct osd_device *dev,
 static inline struct osd_oi *osd_fid2oi(struct osd_device *osd,
                                         const struct lu_fid *fid)
 {
-        LASSERT(!fid_is_idif(fid));
-        LASSERT(!fid_is_igif(fid));
-        LASSERT(osd->od_oi_table != NULL && osd->od_oi_count >= 1);
-        /* It can work even od_oi_count equals to 1 although it's unexpected,
-         * the only reason we set it to 1 is for performance measurement */
+       LASSERTF(!fid_is_idif(fid), DFID"\n", PFID(fid));
+       LASSERTF(!fid_is_igif(fid), DFID"\n", PFID(fid));
+       LASSERT(osd->od_oi_table != NULL && osd->od_oi_count >= 1);
+       /* It can work even od_oi_count equals to 1 although it's unexpected,
+        * the only reason we set it to 1 is for performance measurement */
        return osd->od_oi_table[osd_oi_fid2idx(osd, fid)];
 }
 
index 737e8d3..544eabc 100644 (file)
@@ -615,6 +615,9 @@ int osd_oi_delete(struct osd_thread_info *info,
 {
        struct lu_fid *oi_fid = &info->oti_fid2;
 
+       if (fid_is_igif(fid))
+               return 0;
+
        LASSERT(fid_seq(fid) != FID_SEQ_LOCAL_FILE);
 
        if (fid_is_idif(fid) || fid_seq(fid) == FID_SEQ_LLOG)