X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=blobdiff_plain;f=lustre%2Ftests%2Fsanity-lfsck.sh;h=81cea0f92c9a7355a81ea1ac5e11ad97d99c5398;hp=0cc7474135827d15cd7b3473e3baa813a421169a;hb=3e37d73b011ac1203c8cdd9f696652812bde5d2e;hpb=f5491211ed7251a45e4e6916539cd2a2ab5e6038 diff --git a/lustre/tests/sanity-lfsck.sh b/lustre/tests/sanity-lfsck.sh index 0cc7474..81cea0f 100644 --- a/lustre/tests/sanity-lfsck.sh +++ b/lustre/tests/sanity-lfsck.sh @@ -284,6 +284,45 @@ test_2b() } run_test 2b "LFSCK can find out and remove invalid linkEA entry" +test_2c() +{ + lfsck_prep 1 1 + echo "start $SINGLEMDS" + start $SINGLEMDS $MDT_DEVNAME $MOUNT_OPTS_SCRUB > /dev/null || + error "(1) Fail to start MDS!" + + mount_client $MOUNT || error "(2) Fail to start client!" + + #define OBD_FAIL_LFSCK_LINKEA_MORE2 0x1605 + do_facet $SINGLEMDS $LCTL set_param fail_loc=0x1605 + touch $DIR/$tdir/dummy + + do_facet $SINGLEMDS $LCTL set_param fail_loc=0 + umount_client $MOUNT + $START_NAMESPACE || error "(3) Fail to start LFSCK for namespace!" + + sleep 3 + local STATUS=$($SHOW_NAMESPACE | awk '/^status/ { print $2 }') + [ "$STATUS" == "completed" ] || + error "(4) Expect 'completed', but got '$STATUS'" + + local repaired=$($SHOW_NAMESPACE | + awk '/^updated_phase2/ { print $2 }') + [ $repaired -eq 1 ] || + error "(5) Fail to repair crashed linkEA: $repaired" + + mount_client $MOUNT || error "(6) Fail to start client!" + + stat $DIR/$tdir/dummy | grep "Links: 1" > /dev/null || + error "(7) Fail to stat $DIR/$tdir/dummy" + + local dummyfid=$($LFS path2fid $DIR/$tdir/dummy) + local dummyname=$($LFS fid2path $DIR $dummyfid) + [ "$dummyname" == "$DIR/$tdir/dummy" ] || + error "(8) Fail to repair linkEA: $dummyfid $dummyname" +} +run_test 2c "LFSCK can find out and remove repeated linkEA entry" + test_4() { lfsck_prep 3 3