X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;ds=sidebyside;f=lustre%2Ftests%2Fsanity-scrub.sh;h=f01e450fdbef83784807c5ea7df5be45a70118ba;hb=558784caad;hp=8796cb4993033a2e3edf7621eacd1c168f6073a9;hpb=c74c630ff7596317d1b500fd385fca271b31708c;p=fs%2Flustre-release.git diff --git a/lustre/tests/sanity-scrub.sh b/lustre/tests/sanity-scrub.sh index 8796cb4..f01e450 100644 --- a/lustre/tests/sanity-scrub.sh +++ b/lustre/tests/sanity-scrub.sh @@ -1382,6 +1382,38 @@ test_19() { } run_test 19 "LFSCK can fix multiple linked files on OST" +test_20() { + [ "$mds1_FSTYPE" == "ldiskfs" ] || skip "ldiskfs only test" + + check_mount_and_prep + + rm -rf $DIR/$tdir + mkdir_on_mdt0 $DIR/$tdir || error "mkdir $tdir failed" + #define OBD_FAIL_OSD_FID_MAPPING 0x193 + do_facet mds1 $LCTL set_param fail_loc=0x193 + chmod 757 $DIR/$tdir || error "chmod $tdir failed" + + stop mds1 + start mds1 $(mdsdevname 1) $MOUNT_OPTS_NOSCRUB + scrub_enable_auto + + local sec + + #define OBD_FAIL_OSD_SCRUB_IRREPARABLE 0x19f + do_facet mds1 $LCTL set_param fail_loc=0x19f + stat $DIR/$tdir && error "stat $tdir should fail" + sec=$(scrub_status 1 | awk '/^time_since_latest_start/ { print $2 }') + echo "OI scrub was triggerred $sec seconds ago" + + sleep 5 + # OI mappings are irreparable, which shouldn't trigger scrub again + stat $DIR/$tdir && error "stat $tdir should fail" + sec=$(scrub_status 1 | awk '/^time_since_latest_start/ { print $2 }') + echo "OI scrub was triggerred $sec seconds ago" + (( sec >= 5 )) || error "OI scrub retriggered" +} +run_test 20 "Don't trigger OI scrub for irreparable oi repeatedly" + # restore MDS/OST size MDSSIZE=${SAVED_MDSSIZE} OSTSIZE=${SAVED_OSTSIZE}