Whamcloud - gitweb
LU-5710 corrected some typos and grammar errors
[fs/lustre-release.git] / lustre / tests / replay-single.sh
index 3068765..f657ec4 100755 (executable)
@@ -1069,17 +1069,28 @@ run_test 50 "Double OSC recovery, don't LASSERT (3812)"
 
 # b3764 timed out lock replay
 test_52() {
-    touch $DIR/$tfile
-    cancel_lru_locks mdc
+       [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.90) ] &&
+               skip "MDS prior to 2.6.90 handle LDLM_REPLY_NET incorrectly" &&
+               return 0
 
-    multiop $DIR/$tfile s || return 1
-    replay_barrier $SINGLEMDS
-#define OBD_FAIL_LDLM_REPLY              0x30c
-    do_facet $SINGLEMDS "lctl set_param fail_loc=0x8000030c"
-    fail $SINGLEMDS || return 2
-    do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
+       touch $DIR/$tfile
+       cancel_lru_locks mdc
+
+       multiop_bg_pause $DIR/$tfile s_s || return 1
+       mpid=$!
+
+       #define OBD_FAIL_MDS_LDLM_REPLY_NET     0x157
+       lctl set_param -n ldlm.cancel_unused_locks_before_replay "0"
+       do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000157"
 
-    $CHECKSTAT -t file $DIR/$tfile-* && return 3 || true
+       fail $SINGLEMDS || return 2
+       kill -USR1 $mpid
+       wait $mpid || return 3
+
+       do_facet $SINGLEMDS "lctl set_param fail_loc=0x0"
+       lctl set_param fail_loc=0x0
+       lctl set_param -n ldlm.cancel_unused_locks_before_replay "1"
+       rm -f $DIR/$tfile
 }
 run_test 52 "time out lock replay (3764)"
 
@@ -1988,22 +1999,6 @@ test_73b() {
 }
 run_test 73b "open(O_CREAT), unlink, replay, reconnect at open_replay reply, close"
 
-test_73c() {
-    multiop_bg_pause $DIR/$tfile O_tSc || return 3
-    pid=$!
-    rm -f $DIR/$tfile
-
-    replay_barrier $SINGLEMDS
-#define OBD_FAIL_TGT_LAST_REPLAY       0x710
-    do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000710"
-    fail $SINGLEMDS
-    kill -USR1 $pid
-    wait $pid || return 1
-    [ -e $DIR/$tfile ] && return 2
-    return 0
-}
-run_test 73c "open(O_CREAT), unlink, replay, reconnect at last_replay, close"
-
 # bug 18554
 test_74() {
     local clients=${CLIENTS:-$HOSTNAME}
@@ -2043,7 +2038,7 @@ test_80a() {
        local remote_dir=$DIR/$tdir/remote_dir
 
        mkdir -p $DIR/$tdir
-       #define OBD_FAIL_UPDATE_OBJ_NET_REP     0x1701
+       #define OBD_FAIL_OUT_UPDATE_NET_REP     0x1701
        do_facet mds${MDTIDX} lctl set_param fail_loc=0x1701
        $LFS mkdir -i $MDTIDX $remote_dir &
        local CLIENT_PID=$!
@@ -2487,26 +2482,6 @@ test_81h() {
 }
 run_test 81h "DNE: unlink remote dir, drop request reply, fail 2 MDTs"
 
-test_83a() {
-    mkdir -p $DIR/$tdir
-    createmany -o $DIR/$tdir/$tfile- 10 || return 1
-#define OBD_FAIL_MDS_FAIL_LOV_LOG_ADD       0x140
-    do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000140"
-    unlinkmany $DIR/$tdir/$tfile- 10 || return 2
-}
-run_test 83a "fail log_add during unlink recovery"
-
-test_83b() {
-    mkdir -p $DIR/$tdir
-    createmany -o $DIR/$tdir/$tfile- 10 || return 1
-    replay_barrier $SINGLEMDS
-    unlinkmany $DIR/$tdir/$tfile- 10 || return 2
-#define OBD_FAIL_MDS_FAIL_LOV_LOG_ADD       0x140
-    do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000140"
-    fail $SINGLEMDS
-}
-run_test 83b "fail log_add during unlink recovery"
-
 test_84a() {
 #define OBD_FAIL_MDS_OPEN_WAIT_CREATE  0x144
     do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000144"
@@ -2684,7 +2659,7 @@ test_88() { #bug 17485
         dd if=/dev/urandom of=$DIR/$tdir/f-$file_id bs=4096 count=128
     done
 
-    # if the objids were not recreated, then "ls" will failed for -ENOENT
+    # if the objids were not recreated, then "ls" will fail with -ENOENT
     ls -l $DIR/$tdir/* || error "can't get the status of precreated files"
 
     local file_id
@@ -2870,7 +2845,7 @@ test_100a() {
        #otherwise it may create single stripe dir here
        $LFS setdirstripe -i1 $DIR/$tdir/remote_dir
 
-       #define OBD_FAIL_UPDATE_OBJ_NET_REP     0x1701
+       #define OBD_FAIL_OUT_UPDATE_NET_REP     0x1701
        do_facet mds$((MDTIDX+1)) lctl set_param fail_loc=0x1701
        $LFS setdirstripe -i0 -c2 $striped_dir &
        local CLIENT_PID=$!
@@ -2914,6 +2889,28 @@ test_100b() {
 }
 run_test 100b "DNE: create striped dir, fail MDT0"
 
+test_101() { #LU-5648
+       mkdir -p $DIR/$tdir/d1
+       mkdir -p $DIR/$tdir/d2
+       touch $DIR/$tdir/file0
+       num=1000
+
+       replay_barrier $SINGLEMDS
+       for i in $(seq $num) ; do
+               echo test$i > $DIR/$tdir/d1/file$i
+       done
+
+       fail_abort $SINGLEMDS
+       for i in $(seq $num) ; do
+               touch $DIR/$tdir/d2/file$i
+               test -s $DIR/$tdir/d2/file$i &&
+                       ls -al $DIR/$tdir/d2/file$i && error "file$i's size > 0"
+       done
+
+       rm -rf $DIR/$tdir
+}
+run_test 101 "Shouldn't reassign precreated objs to other files after recovery"
+
 complete $SECONDS
 check_and_cleanup_lustre
 exit_status