Whamcloud - gitweb
b=18233 fix read+truncate livelock
[fs/lustre-release.git] / lustre / tests / sanity.sh
index 4dd6297..18ee710 100755 (executable)
@@ -44,7 +44,6 @@ MCREATE=${MCREATE:-mcreate}
 OPENFILE=${OPENFILE:-openfile}
 OPENUNLINK=${OPENUNLINK:-openunlink}
 READS=${READS:-"reads"}
-TRUNCATE=${TRUNCATE:-truncate}
 MUNLINK=${MUNLINK:-munlink}
 SOCKETSERVER=${SOCKETSERVER:-socketserver}
 SOCKETCLIENT=${SOCKETCLIENT:-socketclient}
@@ -127,7 +126,7 @@ rm -rf $DIR/[Rdfs][0-9]*
 # $RUNAS_ID may get set incorrectly somewhere else
 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
 
-check_runas_id $RUNAS_ID $RUNAS_ID $RUNAS
+check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
 
 build_test_filter
 
@@ -301,16 +300,16 @@ test_6g() {
         $RUNAS mkdir $DIR/d6g/d || error
         chmod g+s $DIR/d6g/d || error
         mkdir $DIR/d6g/d/subdir
-       $CHECKSTAT -g \#$RUNAS_ID $DIR/d6g/d/subdir || error
+       $CHECKSTAT -g \#$RUNAS_GID $DIR/d6g/d/subdir || error
 }
 run_test 6g "Is new dir in sgid dir inheriting group?"
 
 test_6h() { # bug 7331
        [ $RUNAS_ID -eq $UID ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
        touch $DIR/f6h || error "touch failed"
-       chown $RUNAS_ID:$RUNAS_ID $DIR/f6h || error "initial chown failed"
-       $RUNAS -G$RUNAS_ID chown $RUNAS_ID:0 $DIR/f6h && error "chown worked"
-       $CHECKSTAT -t file -u \#$RUNAS_ID -g \#$RUNAS_ID $DIR/f6h || error
+       chown $RUNAS_ID:$RUNAS_GID $DIR/f6h || error "initial chown failed"
+       $RUNAS -G$RUNAS_GID chown $RUNAS_ID:0 $DIR/f6h && error "chown worked"
+       $CHECKSTAT -t file -u \#$RUNAS_ID -g \#$RUNAS_GID $DIR/f6h || error
 }
 run_test 6h "$RUNAS chown RUNAS_ID.0 .../f6h (should return error)"
 
@@ -477,7 +476,7 @@ test_17h() { #bug 17378
         mkdir -p $DIR/$tdir
         $SETSTRIPE $DIR/$tdir -c -1
 #define OBD_FAIL_MDS_LOV_PREP_CREATE 0x141
-        do_facet mds lctl set_param fail_loc=0x80000141
+        do_facet $SINGLEMDS lctl set_param fail_loc=0x80000141
         touch $DIR/$tdir/$tfile || true
 }
 run_test 17h "create objects: lov_free_memmd() doesn't lbug"
@@ -487,7 +486,7 @@ test_17i() { #bug 20018
        local foo=$DIR/$tdir/$tfile
        ln -s $foo $foo || error "create symlink failed"
 #define OBD_FAIL_MDS_READLINK_EPROTO     0x143
-       do_facet mds lctl set_param fail_loc=0x80000143
+       do_facet $SINGLEMDS lctl set_param fail_loc=0x80000143
        ls -l $foo && error "error not detected"
        return 0
 }
@@ -562,13 +561,13 @@ run_test 21 "write to dangling link ============================"
 test_22() {
        WDIR=$DIR/$tdir
        mkdir -p $WDIR
-       chown $RUNAS_ID $WDIR
+       chown $RUNAS_ID:$RUNAS_GID $WDIR
        (cd $WDIR || error "cd $WDIR failed";
        $RUNAS tar cf - /etc/hosts /etc/sysconfig/network | \
        $RUNAS tar xf -)
        ls -lR $WDIR/etc || error "ls -lR $WDIR/etc failed"
        $CHECKSTAT -t dir $WDIR/etc || error "checkstat -t dir failed"
-       $CHECKSTAT -u \#$RUNAS_ID $WDIR/etc || error "checkstat -u failed"
+       $CHECKSTAT -u \#$RUNAS_ID -g \#$RUNAS_GID $WDIR/etc || error "checkstat -u failed"
 }
 run_test 22 "unpack tar archive as non-root user ==============="
 
@@ -805,6 +804,17 @@ test_24v() {
 }
 run_test 24v "list directory with large files (handle hash collision, bug: 17560)"
 
+test_24w() { # bug21506
+        SZ1=234852
+        dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 seek=4096 || return 1
+        dd if=/dev/zero bs=$SZ1 count=1 >> $DIR/$tfile || return 2
+        dd if=$DIR/$tfile of=$DIR/${tfile}_left bs=1M skip=4097 || return 3
+        SZ2=`ls -l $DIR/${tfile}_left | awk '{print $5}'`
+        [ "$SZ1" = "$SZ2" ] || \
+                error "Error reading at the end of the file $tfile"
+}
+run_test 24w "Reading a file larger than 4Gb"
+
 test_25a() {
        echo '== symlink sanity ============================================='
 
@@ -993,7 +1003,7 @@ test_27m() {
 run_test 27m "create file while OST0 was full =================="
 
 sleep_maxage() {
-        local DELAY=$(do_facet mds lctl get_param -n lov.*.qos_maxage | head -n 1 | awk '{print $1 * 2}')
+        local DELAY=$(do_facet $SINGLEMDS lctl get_param -n lov.*.qos_maxage | head -n 1 | awk '{print $1 * 2}')
         sleep $DELAY
 }
 
@@ -1262,7 +1272,7 @@ test_27y() {
         [ $fcount -eq 0 ] && skip "not enough space on OST0" && return
         [ $fcount -gt $OSTCOUNT ] && fcount=$OSTCOUNT
 
-        MDS_OSCS=`do_facet mds lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'`
+        MDS_OSCS=`do_facet $SINGLEMDS lctl dl | awk '/[oO][sS][cC].*md[ts]/ { print $4 }'`
         OFFSET=$(($OSTCOUNT-1))
         OST=-1
         for OSC in $MDS_OSCS; do
@@ -1270,7 +1280,7 @@ test_27y() {
                         OST=`osc_to_ost $OSC`
                 } else {
                         echo $OSC "is Deactivate:"
-                        do_facet mds lctl --device  %$OSC deactivate
+                        do_facet $SINGLEMDS lctl --device  %$OSC deactivate
                 } fi
         done
 
@@ -1290,7 +1300,7 @@ test_27y() {
         for OSC in $MDS_OSCS; do
                 [ `osc_to_ost $OSC` != $OST  ] && {
                         echo $OSC "is activate"
-                        do_facet mds lctl --device %$OSC activate
+                        do_facet $SINGLEMDS lctl --device %$OSC activate
                 }
         done
 }
@@ -1362,6 +1372,22 @@ test_27z() {
 }
 run_test 27z "check SEQ/OID on the MDT and OST filesystems"
 
+test_27A() { # b=19102
+        local restore_size=`$GETSTRIPE -s $MOUNT`
+        local restore_count=`$GETSTRIPE -c $MOUNT`
+        local restore_offset=`$GETSTRIPE -o $MOUNT`
+        $SETSTRIPE -c 0 -o -1 -s 0 $MOUNT
+        local default_size=`$GETSTRIPE -s $MOUNT`
+        local default_count=`$GETSTRIPE -c $MOUNT`
+        local default_offset=`$GETSTRIPE -o $MOUNT`
+        local dsize=$((1024 * 1024))
+        [ $default_size -eq $dsize ] || error "stripe size $default_size != $dsize"
+        [ $default_count -eq 1 ] || error "stripe count $default_count != 1"
+        [ $default_offset -eq -1 ] || error "stripe offset $default_offset != -1"
+        $SETSTRIPE -c $restore_count -o $restore_offset -s $restore_size $MOUNT
+}
+run_test 27A "check filesystem-wide default LOV EA values"
+
 # createtest also checks that device nodes are created and
 # then visible correctly (#2091)
 test_28() { # bug 2091
@@ -2079,11 +2105,11 @@ test_39() {
        $OPENFILE -f O_CREAT:O_TRUNC:O_WRONLY $DIR/${tfile}2
        if [ ! $DIR/${tfile}2 -nt $DIR/$tfile ]; then
                echo "mtime"
-               ls -l  $DIR/$tfile $DIR/${tfile}2
+               ls -l --full-time $DIR/$tfile $DIR/${tfile}2
                echo "atime"
-               ls -lu  $DIR/$tfile $DIR/${tfile}2
+               ls -lu --full-time $DIR/$tfile $DIR/${tfile}2
                echo "ctime"
-               ls -lc  $DIR/$tfile $DIR/${tfile}2
+               ls -lc --full-time $DIR/$tfile $DIR/${tfile}2
                error "O_TRUNC didn't change timestamps"
        fi
 }
@@ -2333,6 +2359,56 @@ test_39k() {
 }
 run_test 39k "write, utime, close, stat ========================"
 
+# this should be set to future
+TEST_39_ATIME=`date -d "1 year" +%s`
+
+test_39l() {
+       local atime_diff=$(do_facet $SINGLEMDS lctl get_param -n mdd.*.atime_diff)
+
+       mkdir -p $DIR/$tdir
+
+       # test setting directory atime to future
+       touch -a -d @$TEST_39_ATIME $DIR/$tdir
+       local atime=$(stat -c %X $DIR/$tdir)
+       [ "$atime" = $TEST_39_ATIME ] || \
+               error "atime is not set to future: $atime, should be $TEST_39_ATIME"
+
+       # test setting directory atime from future to now
+       local d1=$(date +%s)
+       ls $DIR/$tdir
+       local d2=$(date +%s)
+
+       cancel_lru_locks mdc
+       atime=$(stat -c %X $DIR/$tdir)
+       [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] || \
+               error "atime is not updated from future: $atime, should be $d1<atime<$d2"
+
+       do_facet $SINGLEMDS lctl set_param -n mdd.*.atime_diff=2
+       sleep 3
+
+       # test setting directory atime when now > dir atime + atime_diff
+       d1=$(date +%s)
+       ls $DIR/$tdir
+       d2=$(date +%s)
+       cancel_lru_locks mdc
+       atime=$(stat -c %X $DIR/$tdir)
+       [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] || \
+               error "atime is not updated  : $atime, should be $d2"
+
+       do_facet $SINGLEMDS lctl set_param -n mdd.*.atime_diff=60
+       sleep 3
+
+       # test not setting directory atime when now < dir atime + atime_diff
+       ls $DIR/$tdir
+       cancel_lru_locks mdc
+       atime=$(stat -c %X $DIR/$tdir)
+       [ "$atime" -ge "$d1" -a "$atime" -le "$d2" ] || \
+               error "atime is updated to $atime, should remain $d1<atime<$d2"
+
+       do_facet $SINGLEMDS lctl set_param -n mdd.*.atime_diff=$atime_diff
+}
+run_test 39l "directory atime update ==========================="
+
 test_40() {
        dd if=/dev/zero of=$DIR/f40 bs=4096 count=1
        $RUNAS $OPENFILE -f O_WRONLY:O_TRUNC $DIR/f40 && error
@@ -2587,7 +2663,7 @@ test_43b() {
        cp -p `which multiop` $DIR/d43/multiop || cp -p multiop $DIR/d43/multiop
         MULTIOP_PROG=$DIR/d43/multiop multiop_bg_pause $TMP/test43.junk O_c || return 1
         MULTIOP_PID=$!
-        truncate $DIR/d43/multiop 0 && error "expected error, got success"
+        $TRUNCATE $DIR/d43/multiop 0 && error "expected error, got success"
         kill -USR1 $MULTIOP_PID || return 2
         wait $MULTIOP_PID || return 3
         rm $TMP/test43.junk
@@ -3215,8 +3291,8 @@ run_test 56h "check lfs find ! -name ============================="
 test_56i() {
        tdir=${tdir}i
        mkdir -p $DIR/$tdir
-       UUID=`$LFS osts | awk '/0: / { print $2 }'`
-       OUT="`$LFIND -ost $UUID $DIR/$tdir`"
+       UUID=$(ostuuid_from_index 0 $DIR/$tdir)
+       OUT=$($LFIND -obd $UUID $DIR/$tdir)
        [ "$OUT" ] && error "$LFIND returned directory '$OUT'" || true
 }
 run_test 56i "check 'lfs find -ost UUID' skips directories ======="
@@ -3319,14 +3395,14 @@ test_56q() {
 
        setup_56 $NUMFILES $NUMDIRS
 
-       chgrp $RUNAS_ID $TDIR/file* || error "chown $DIR/${tdir}g/file$i failed"
+       chgrp $RUNAS_GID $TDIR/file* || error "chown $DIR/${tdir}g/file$i failed"
        EXPECTED=$NUMFILES
-       NUMS="`$LFIND -gid $RUNAS_ID $TDIR | wc -l`"
+       NUMS="`$LFIND -gid $RUNAS_GID $TDIR | wc -l`"
        [ $NUMS -eq $EXPECTED ] || \
                error "lfs find -gid $TDIR wrong: found $NUMS, expected $EXPECTED"
 
        EXPECTED=$(( ($NUMFILES+1) * $NUMDIRS + 1))
-       NUMS="`$LFIND ! -gid $RUNAS_ID $TDIR | wc -l`"
+       NUMS="`$LFIND ! -gid $RUNAS_GID $TDIR | wc -l`"
        [ $NUMS -eq $EXPECTED ] || \
                error "lfs find ! -gid $TDIR wrong: found $NUMS, expected $EXPECTED"
 
@@ -3334,6 +3410,39 @@ test_56q() {
 }
 run_test 56q "check lfs find -gid and ! -gid ==============================="
 
+test_56r() {
+       setup_56 $NUMFILES $NUMDIRS
+       TDIR=$DIR/${tdir}g
+       
+       EXPECTED=12
+       NUMS=`$LFIND -size 0 -t f $TDIR | wc -l`
+       [ $NUMS -eq $EXPECTED ] || \
+               error "lfs find $TDIR -size 0 wrong: found $NUMS, expected $EXPECTED"
+       EXPECTED=0
+       NUMS=`$LFIND ! -size 0 -t f $TDIR | wc -l`
+       [ $NUMS -eq $EXPECTED ] || \
+               error "lfs find $TDIR ! -size 0 wrong: found $NUMS, expected $EXPECTED"
+       echo "test" > $TDIR/56r && sync
+       EXPECTED=1
+       NUMS=`$LFIND -size 5 -t f $TDIR | wc -l`
+       [ $NUMS -eq $EXPECTED ] || \
+               error "lfs find $TDIR -size 5 wrong: found $NUMS, expected $EXPECTED"
+       EXPECTED=1
+       NUMS=`$LFIND -size +5 -t f $TDIR | wc -l`
+       [ $NUMS -eq $EXPECTED ] || \
+               error "lfs find $TDIR -size +5 wrong: found $NUMS, expected $EXPECTED"
+       EXPECTED=13
+       NUMS=`$LFIND -size +0 -t f $TDIR | wc -l`
+       [ $NUMS -eq $EXPECTED ] || \
+               error "lfs find $TDIR -size +0 wrong: found $NUMS, expected $EXPECTED"
+       EXPECTED=0
+       NUMS=`$LFIND ! -size -5 -t f $TDIR | wc -l`
+       [ $NUMS -eq $EXPECTED ] || \
+               error "lfs find $TDIR ! -size -5 wrong: found $NUMS, expected $EXPECTED"
+}
+
+run_test 56r "check lfs find -size works =========================="
+
 test_57a() {
        # note test will not do anything if MDS is not local
        remote_mds_nodsh && skip "remote MDS with nodsh" && return
@@ -3670,7 +3779,7 @@ test_65k() { # bug11679
                         STRIPE_INDEX=`do_facet $SINGLEMDS lctl get_param -n lov.*md*.target_obd |
                                       grep $STRIPE_OST | awk -F: '{print $1}' | head -n 1`
 
-                       [ -f $DIR/$tdir/${STRIPE_INDEX} ] && continue
+                [ -f $DIR/$tdir/${STRIPE_INDEX} ] && continue
                         echo "$SETSTRIPE $DIR/$tdir/${STRIPE_INDEX} -i ${STRIPE_INDEX} -c 1"
                         do_facet client $SETSTRIPE $DIR/$tdir/${STRIPE_INDEX} -i ${STRIPE_INDEX} -c 1
                         RC=$?
@@ -3803,7 +3912,7 @@ test_69() {
        $DIRECTIO write ${f}.2 0 1 || error "directio write error"
 
        do_facet ost1 lctl set_param fail_loc=0x217
-       truncate $f 1 # vmtruncate() will ignore truncate() error.
+       $TRUNCATE $f 1 # vmtruncate() will ignore truncate() error.
        $DIRECTIO write $f 0 2 && error "write succeeded, expect -ENOENT"
 
        do_facet ost1 lctl set_param fail_loc=0
@@ -3831,7 +3940,7 @@ test_72() { # bug 5695 - Test that on 2.6 remove_suid works properly
        [ "$RUNAS_ID" = "$UID" ] && skip_env "RUNAS_ID = UID = $UID -- skipping" && return
 
         # Check that testing environment is properly set up. Skip if not
-        FAIL_ON_ERROR=false check_runas_id_ret $RUNAS_ID $RUNAS_ID $RUNAS || {
+        FAIL_ON_ERROR=false check_runas_id_ret $RUNAS_ID $RUNAS_GID $RUNAS || {
                 skip_env "User $RUNAS_ID does not exist - skipping"
                 return 0
         }
@@ -4772,7 +4881,7 @@ test_102k() {
         local default_size=`$GETSTRIPE -s $test_kdir`
         local default_count=`$GETSTRIPE -c $test_kdir`
         local default_offset=`$GETSTRIPE -o $test_kdir`
-        $SETSTRIPE -s 65536 -i 1 -c 2 $test_kdir || error 'dir setstripe failed'
+        $SETSTRIPE -s 65536 -i 1 -c $OSTCOUNT $test_kdir || error 'dir setstripe failed'
         setfattr -n trusted.lov $test_kdir
         local stripe_size=`$GETSTRIPE -s $test_kdir`
         local stripe_count=`$GETSTRIPE -c $test_kdir`
@@ -6068,6 +6177,7 @@ set_dir_limits () {
                 devs=$(do_node $node "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }')
                for dev in $devs; do
                        mntdev=$(do_node $node "lctl get_param -n osd*.$dev.mntdev")
+                       do_node $node "test -e $LDPROC/\\\$(basename $mntdev)/max_dir_size" || LDPROC=/sys/fs/ldiskfs
                        do_node $node "echo $1 >$LDPROC/\\\$(basename $mntdev)/max_dir_size"
                done
        done
@@ -6991,42 +7101,47 @@ check_path() {
        err17935 "path looked up \"${path}\" instead of \"${expected}\""
        return 2
     fi
-    echo "fid $fid resolves to path $path"
+    echo "fid $fid resolves to path $path (expected $expected)"
 }
 
 test_162() {
-    # Make changes to filesystem
-    mkdir -p $DIR/$tdir/d2
-    touch $DIR/$tdir/d2/$tfile
-    touch $DIR/$tdir/d2/x1
-    touch $DIR/$tdir/d2/x2
-    mkdir -p $DIR/$tdir/d2/a/b/c
-    mkdir -p $DIR/$tdir/d2/p/q/r
+       # Make changes to filesystem
+       mkdir -p $DIR/$tdir/d2
+       touch $DIR/$tdir/d2/$tfile
+       touch $DIR/$tdir/d2/x1
+       touch $DIR/$tdir/d2/x2
+       mkdir -p $DIR/$tdir/d2/a/b/c
+       mkdir -p $DIR/$tdir/d2/p/q/r
        # regular file
-    FID=$($LFS path2fid $DIR/$tdir/d2/$tfile | tr -d '[')
-    check_path "$tdir/d2/$tfile" $FSNAME $FID --link 0
+       FID=$($LFS path2fid $DIR/$tdir/d2/$tfile | tr -d '[]')
+       check_path "$tdir/d2/$tfile" $FSNAME $FID --link 0
 
        # softlink
-    ln -s $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/slink
-    FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink | tr -d '[')
-    check_path "$tdir/d2/p/q/r/slink" $FSNAME $FID --link 0
+       ln -s $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/slink
+       FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink | tr -d '[]')
+       check_path "$tdir/d2/p/q/r/slink" $FSNAME $FID --link 0
+
+       # softlink to wrong file
+       ln -s /this/is/garbage $DIR/$tdir/d2/p/q/r/slink.wrong
+       FID=$($LFS path2fid $DIR/$tdir/d2/p/q/r/slink.wrong | tr -d '[]')
+       check_path "$tdir/d2/p/q/r/slink.wrong" $FSNAME $FID --link 0
 
        # hardlink
-    ln $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/hlink
-    mv $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/a/b/c/new_file
-    FID=$($LFS path2fid $DIR/$tdir/d2/a/b/c/new_file | tr -d '[')
-    # fid2path dir/fsname should both work
-    check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1
-    check_path "$DIR/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0
-
-    # hardlink count: check that there are 2 links
-    # Doesnt work with CMD yet: 17935
+       ln $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/p/q/r/hlink
+       mv $DIR/$tdir/d2/$tfile $DIR/$tdir/d2/a/b/c/new_file
+       FID=$($LFS path2fid $DIR/$tdir/d2/a/b/c/new_file | tr -d '[]')
+       # fid2path dir/fsname should both work
+       check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 1
+       check_path "$DIR/$tdir/d2/p/q/r/hlink" $DIR $FID --link 0
+
+       # hardlink count: check that there are 2 links
+       # Doesnt work with CMD yet: 17935
        ${LFS} fid2path $DIR $FID | wc -l | grep -q 2 || \
                err17935 "expected 2 links"
 
        # hardlink indexing: remove the first link
-    rm $DIR/$tdir/d2/p/q/r/hlink
-    check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 0
+       rm $DIR/$tdir/d2/p/q/r/hlink
+       check_path "$tdir/d2/a/b/c/new_file" $FSNAME $FID --link 0
 
        return 0
 }
@@ -7039,7 +7154,7 @@ test_163() {
        sleep 1
        local uuid=$($LCTL get_param -n mdc.${FSNAME}-MDT0000-mdc-*.uuid)
        # this proc file is temporary and linux-only
-       do_facet mds lctl set_param mdt.${FSNAME}-MDT0000.mdccomm=$uuid ||\
+       do_facet $SINGLEMDS lctl set_param mdt.${FSNAME}-MDT0000.mdccomm=$uuid ||\
          error "kernel->userspace send failed"
        kill -INT $!
 }
@@ -7283,8 +7398,8 @@ run_test 200c "Set pool on a directory ================================="
 
 test_200d() {
        remote_mgs_nodsh && skip "remote MGS with nodsh" && return
-       res=$($GETSTRIPE --pool $POOL_DIR | awk '/^pool:/ {print $2}')
-       [ "$res" = $POOL ] || error "Pool on $POOL_DIR is $res, not $POOL"
+       res=$($GETSTRIPE --pool $POOL_DIR)
+       [ $res = $POOL ] || error "Pool on $POOL_DIR is $res, not $POOL"
 }
 run_test 200d "Check pool on a directory ==============================="
 
@@ -7578,6 +7693,36 @@ test_216() { # bug 20317
 }
 run_test 216 "check lockless direct write works and updates file size and kms correctly"
 
+test_217() { # bug 22430
+       local node
+       for node in $(nodes_list); do
+               if [[ $node = *-* ]] ; then
+                       echo "lctl ping $node@$NETTYPE"
+                       lctl ping $node@$NETTYPE
+               else
+                       echo "skipping $node (no hiphen detected)"
+               fi
+       done
+}
+run_test 217 "check lctl ping for hostnames with hiphen ('-')"
+
+test_218() {
+       # do directio so as not to populate the page cache
+       log "creating a 10 Mb file"
+       multiop $DIR/$tfile oO_CREAT:O_DIRECT:O_RDWR:w$((10*1048576))c || error "multiop failed while creating a file"
+       log "starting reads"
+       dd if=$DIR/$tfile of=/dev/null bs=4096 &
+       log "truncating the file"
+       multiop $DIR/$tfile oO_TRUNC:c || error "multiop failed while truncating the file"
+       log "killing dd"
+       kill %+ || true # reads might have finished
+       echo "wait until dd is finished"
+       wait
+       log "removing the temporary file"
+       rm -rf $DIR/$tfile || error "tmp file removal failed"
+}
+run_test 218 "parallel read and truncate should not deadlock ======================="
+
 #
 # tests that do cleanup/setup should be run at the end
 #