From: Li Wei Date: Sun, 17 Jun 2012 05:16:47 +0000 (+0800) Subject: LU-1534 osd: Fix LBUGs when destroying IGIF objects X-Git-Tag: 2.2.58~35 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=3ad0df02123a49a8c98ecf4661f677af509ac6d4;hp=b3b8bc5dfc3122774322a8d77a2fa1f23573cef6 LU-1534 osd: Fix LBUGs when destroying IGIF objects 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 Change-Id: I95fe9db8aec53a496a8dc84c87594ed81f3fe106 Signed-off-by: Li Wei Reviewed-on: http://review.whamcloud.com/3120 Reviewed-by: Fan Yong Reviewed-by: Andreas Dilger Tested-by: Hudson --- diff --git a/lustre/osd-ldiskfs/osd_internal.h b/lustre/osd-ldiskfs/osd_internal.h index f75bb7e..307ecfa 100644 --- a/lustre/osd-ldiskfs/osd_internal.h +++ b/lustre/osd-ldiskfs/osd_internal.h @@ -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)]; } diff --git a/lustre/osd-ldiskfs/osd_oi.c b/lustre/osd-ldiskfs/osd_oi.c index 737e8d3..544eabc 100644 --- a/lustre/osd-ldiskfs/osd_oi.c +++ b/lustre/osd-ldiskfs/osd_oi.c @@ -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)