Whamcloud - gitweb
LU-7830 ost: do not evict during truncate
[fs/lustre-release.git] / lustre / tests / recovery-small.sh
index 51f5e1f..e833e58 100755 (executable)
@@ -16,8 +16,8 @@ init_logging
 require_dsh_mds || exit 0
 
 # also long tests: 19, 21a, 21e, 21f, 23, 27
-#                                   1  2.5  2.5    4    4          (min)"
-[ "$SLOW" = "no" ] && EXCEPT_SLOW="17  26a  26b    50   51     57"
+
+[ "$SLOW" = "no" ] && EXCEPT_SLOW=""
 
 [ $(facet_fstype $SINGLEMDS) = "zfs" ] &&
 # bug number for skipped test:       LU-2547
@@ -308,7 +308,7 @@ run_test 11 "wake up a thread waiting for completion after eviction (b=2460)"
 
 #b=2494
 test_12(){
-       $LCTL mark $MULTIOP $DIR/$tfile OS_c
+       $LCTL mark "$HOSTNAME: $MULTIOP $DIR/$tfile OS_c"
        do_facet $SINGLEMDS "lctl set_param fail_loc=0x115"
        clear_failloc $SINGLEMDS $((TIMEOUT * 2)) &
        multiop_bg_pause $DIR/$tfile OS_c ||
@@ -2258,7 +2258,7 @@ test_130_base() {
 
        # Prevent interference from layout intent RPCs due to
        # asynchronous writeback. These will be tested in 130c below.
-       sync
+       do_nodes ${CLIENTS:-$HOSTNAME} sync
 
        # get only LOOKUP lock on $tdir
        cancel_lru_locks mdc
@@ -2309,7 +2309,7 @@ run_test 130b "enqueue resend on a stale inode"
 test_130c() {
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
 
-       sync
+       do_nodes ${CLIENTS:-$HOSTNAME} sync
        echo XXX > $DIR/$tfile
 
        cancel_lru_locks mdc
@@ -2344,6 +2344,41 @@ test_130c() {
 }
 run_test 130c "layout intent resend on a stale inode"
 
+test_132() {
+       local before=$(date +%s)
+       local evict
+
+       mount_client $MOUNT2 || error "mount filed"
+
+       rm -f $DIR/$tfile
+       # get a lock on client so that export would reach the stale list
+       $SETSTRIPE -i 0 $DIR/$tfile || error "setstripe failed"
+       dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 conv=fsync ||
+               error "dd failed"
+
+       #define OBD_FAIL_OST_PAUSE_PUNCH         0x236
+       do_facet ost1 $LCTL set_param fail_val=120 fail_loc=0x80000236
+
+       $TRUNCATE $DIR/$tfile 100 &
+
+       sleep 1
+       dd if=/dev/zero of=$DIR2/$tfile bs=4096 count=1 conv=notrunc ||
+               error "dd failed"
+
+       wait
+       umount_client $MOUNT2
+
+       evict=$(do_facet client $LCTL get_param \
+               osc.$FSNAME-OST0000-osc-*/state |
+           awk -F"[ [,]" '/EVICTED ]$/ { if (t<$5) {t=$5;} } END { print t }')
+
+       [ -z "$evict" ] || [[ $evict -le $before ]] ||
+               (do_facet client $LCTL get_param \
+                       osc.$FSNAME-OST0000-osc-*/state;
+                   error "eviction happened: $evict before:$before")
+}
+run_test 132 "long punch"
+
 complete $SECONDS
 check_and_cleanup_lustre
 exit_status