Whamcloud - gitweb
LU-5248 osd: NOT inject OBD_FAIL_FID_LOOKUP on dotdot 06/11006/4
authorFan Yong <fan.yong@intel.com>
Sat, 20 Sep 2014 05:44:06 +0000 (22:44 -0700)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 4 Dec 2014 20:30:39 +0000 (20:30 +0000)
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 <fan.yong@intel.com>
Change-Id: Iedf3b140a1dcc9fd77b40dbdf3dee52a44b5814b
Reviewed-on: http://review.whamcloud.com/11006
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
lustre/osd-ldiskfs/osd_handler.c
lustre/tests/sanity-lfsck.sh

index 290b31c..b01f028 100644 (file)
@@ -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);
index 4d203d6..23139b0 100644 (file)
@@ -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"