+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 ======================="
+
+test_219() {
+ # write one partial page
+ dd if=/dev/zero of=$DIR/$tfile bs=1024 count=1
+ # set no grant so vvp_io_commit_write will do sync write
+ $LCTL set_param fail_loc=0x411
+ # write a full page at the end of file
+ dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 seek=1 conv=notrunc
+
+ $LCTL set_param fail_loc=0
+ dd if=/dev/zero of=$DIR/$tfile bs=4096 count=1 seek=3
+ $LCTL set_param fail_loc=0x411
+ dd if=/dev/zero of=$DIR/$tfile bs=1024 count=1 seek=2 conv=notrunc
+}
+run_test 219 "LU-394: Write partial won't cause uncontiguous pages vec at LND"
+
+test_220() { #LU-325
+ local OSTIDX=0
+
+ mkdir -p $DIR/$tdir
+ local OST=$(lfs osts | grep ${OSTIDX}": " | \
+ awk '{print $2}' | sed -e 's/_UUID$//')
+
+ # on the mdt's osc
+ local mdtosc_proc1=$(get_mdtosc_proc_path $SINGLEMDS $OST)
+ local last_id=$(do_facet $SINGLEMDS lctl get_param -n \
+ osc.$mdtosc_proc1.prealloc_last_id)
+ local next_id=$(do_facet $SINGLEMDS lctl get_param -n \
+ osc.$mdtosc_proc1.prealloc_next_id)
+
+ $LFS df -i
+
+ do_facet mgs $LCTL pool_new $FSNAME.$TESTNAME || return 1
+ do_facet mgs $LCTL pool_add $FSNAME.$TESTNAME $OST || return 2
+
+ $SETSTRIPE $DIR/$tdir -i $OSTIDX -c 1 -p $FSNAME.$TESTNAME
+
+ echo "preallocated objects in MDS is $((last_id - next_id))" \
+ "($last_id - $next_id)"
+
+ count=$($LFS df -i $MOUNT | grep ^$OST | awk '{print $4}')
+ echo "OST still has $count objects"
+
+ free=$((count + last_id - next_id))
+ echo "create $((free - next_id)) files @next_id..."
+ createmany -o $DIR/$tdir/f $next_id $free || return 3
+
+ local last_id2=$(do_facet mds${MDSIDX} lctl get_param -n \
+ osc.$mdtosc_proc1.prealloc_last_id)
+ local next_id2=$(do_facet mds${MDSIDX} lctl get_param -n \
+ osc.$mdtosc_proc1.prealloc_next_id)
+
+ echo "after creation, last_id=$last_id2, next_id=$next_id2"
+ $LFS df -i
+
+ echo "cleanup..."
+
+ do_facet mgs $LCTL pool_remove $FSNAME.$TESTNAME $OST || return 4
+ do_facet mgs $LCTL pool_destroy $FSNAME.$TESTNAME || return 5
+ echo "unlink $((free - next_id)) files @ $next_id..."
+ unlinkmany $DIR/$tdir/f $next_id $free || return 3
+}
+run_test 220 "the preallocated objects in MDS still can be used if ENOSPC is returned by OST with enough disk space"
+
+test_221() {
+ cp `which date` $MOUNT
+
+ #define OBD_FAIL_LLITE_FAULT_TRUNC_RACE 0x1401
+ $LCTL set_param fail_loc=0x80001401
+
+ $MOUNT/date > /dev/null
+ rm -f $MOUNT/date
+}
+run_test 221 "make sure fault and truncate race to not cause OOM"
+