From c202c54d6d84f54560474f3a6f316af4fdd9e475 Mon Sep 17 00:00:00 2001 From: Fan Yong Date: Fri, 19 Sep 2014 22:44:06 -0700 Subject: [PATCH] LU-5248 osd: NOT inject OBD_FAIL_FID_LOOKUP on dotdot The namespace LFSCK may cannot rebuild the FID-in-dirent for dotdot entry after the MDT restored from file-level backup, because there is not enough space in the directory head area. Lustre-change: http://review.whamcloud.com/9748 Lustre-commit: 7dec22d474faa50e1a7fb6b377ceb1310b76a8e8 Signed-off-by: Fan Yong Change-Id: Iedf3b140a1dcc9fd77b40dbdf3dee52a44b5814b Reviewed-on: http://review.whamcloud.com/11006 Tested-by: Jenkins Tested-by: Maloo Reviewed-by: Emoly Liu Reviewed-by: Andreas Dilger --- lustre/osd-ldiskfs/osd_handler.c | 5 ++++- lustre/tests/sanity-lfsck.sh | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lustre/osd-ldiskfs/osd_handler.c b/lustre/osd-ldiskfs/osd_handler.c index 290b31c..b01f028 100644 --- a/lustre/osd-ldiskfs/osd_handler.c +++ b/lustre/osd-ldiskfs/osd_handler.c @@ -5307,7 +5307,10 @@ static inline int osd_it_ea_rec(const struct lu_env *env, } else { attr &= ~LU_DIRENT_ATTRS_MASK; if (!fid_is_sane(fid)) { - if (OBD_FAIL_CHECK(OBD_FAIL_FID_LOOKUP)) + if (OBD_FAIL_CHECK(OBD_FAIL_FID_LOOKUP) && + likely(it->oie_dirent->oied_namelen != 2 || + it->oie_dirent->oied_name[0] != '.' || + it->oie_dirent->oied_name[1] != '.')) RETURN(-ENOENT); rc = osd_ea_fid_get(env, obj, ino, fid, id); diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 4d203d6..23139b0 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -388,6 +388,9 @@ test_4() do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1505 ls $DIR/$tdir/ > /dev/null || error "(11) no FID-in-dirent." + local count=$(ls -al $DIR/$tdir | wc -l) + [ $count -gt 9 ] || error "(12) namespace LFSCK failed" + do_facet $SINGLEMDS $LCTL set_param fail_loc=0 } run_test 4 "FID-in-dirent can be rebuilt after MDT file-level backup/restore" -- 1.8.3.1