6 # bug number for skipped test: 3192 LU-1205 15528/3811 16929 9977 15528/11549 18080
7 ALWAYS_EXCEPT=" 14b 18c 19 22 28 29 35 $SANITYN_EXCEPT"
8 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
10 # bug number for skipped test: 12652 12652
11 grep -q 'Enterprise Server 10' /etc/SuSE-release 2> /dev/null &&
12 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11 14" || true
14 # Tests that fail on uml
15 [ "$UML" = "true" ] && EXCEPT="$EXCEPT 7"
17 # It will be ported soon.
21 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
24 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
25 MCREATE=${MCREATE:-mcreate}
26 OPENFILE=${OPENFILE:-openfile}
27 OPENUNLINK=${OPENUNLINK:-openunlink}
28 export MULTIOP=${MULTIOP:-multiop}
29 export TMP=${TMP:-/tmp}
30 MOUNT_2=${MOUNT_2:-"yes"}
31 CHECK_GRANT=${CHECK_GRANT:-"yes"}
32 GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
36 export NAME=${NAME:-local}
38 LUSTRE=${LUSTRE:-`dirname $0`/..}
39 . $LUSTRE/tests/test-framework.sh
43 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
46 [ "$SLOW" = "no" ] && EXCEPT_SLOW="12 23 33a"
53 check_and_setup_lustre
55 LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
56 OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
59 rm -rf $DIR1/[df][0-9]* $DIR1/lnk
61 SAMPLE_FILE=$TMP/$(basename $0 .sh).junk
62 dd if=/dev/urandom of=$SAMPLE_FILE bs=1M count=1
64 # $RUNAS_ID may get set incorrectly somewhere else
65 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
67 check_runas_id $RUNAS_ID $RUNAS_GID $RUNAS
76 [ -f $DIR2/f1 ] || error
78 run_test 1a "check create on 2 mtpt's =========================="
82 $CHECKSTAT -t file -p 0777 $DIR1/f1 || error
85 run_test 1b "check attribute updates on 2 mtpt's ==============="
88 $CHECKSTAT -t file -p 0666 $DIR1/f1 || error
90 run_test 1c "check after remount attribute updates on 2 mtpt's ="
94 $CHECKSTAT -a $DIR1/f1 || error
96 run_test 1d "unlink on one mountpoint removes file on other ===="
102 $CHECKSTAT -t file -p 0777 $DIR1/f2a || error
104 run_test 2a "check cached attribute updates on 2 mtpt's ========"
110 $CHECKSTAT -t file -p 0777 $DIR2/f2b || error
112 run_test 2b "check cached attribute updates on 2 mtpt's ========"
114 # NEED TO SAVE ROOT DIR MODE
117 $CHECKSTAT -t dir -p 0777 $DIR2 || error
119 run_test 2c "check cached attribute updates on 2 mtpt's root ==="
123 $CHECKSTAT -t dir -p 0755 $DIR2 || error
125 run_test 2d "check cached attribute updates on 2 mtpt's root ==="
132 $RUNAS dd if=/dev/zero of=$DIR2/$tfile count=1 || error
134 run_test 2e "check chmod on root is propagated to others"
137 local target="this/is/good"
138 ln -s $target $DIR1/$tfile || error "ln -s $target $DIR1/$tfile failed"
139 [ "$(ls -l $DIR2/$tfile | sed -e 's/.* -> //')" = "$target" ] ||
140 error "link $DIR2/$tfile not as expected"
142 run_test 3 "symlink on one mtpt, readlink on another ==========="
145 multifstat $DIR1/f4 $DIR2/f4
147 run_test 4 "fstat validation on multiple mount points =========="
151 $TRUNCATE $DIR2/f5 100
152 $CHECKSTAT -t file -s 100 $DIR1/f5 || error
155 run_test 5 "create a file on one mount, truncate it on the other"
158 openunlink $DIR1/$tfile $DIR2/$tfile || \
159 error "openunlink $DIR1/$tfile $DIR2/$tfile"
161 run_test 6 "remove of open file on other node =================="
165 opendirunlink $DIR1/$dir $DIR2/$dir || \
166 error "opendirunlink $DIR1/$dir $DIR2/$dir"
168 run_test 7 "remove of open directory on other node ============="
171 opendevunlink $DIR1/$tfile $DIR2/$tfile || \
172 error "opendevunlink $DIR1/$tfile $DIR2/$tfile"
174 run_test 8 "remove of open special file on other node =========="
180 for C in a b c d e f g h i j k l; do
181 dir=`eval echo \\$DIR$MTPT`
182 echo -n $C >> $dir/f9
183 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
185 [ "`cat $DIR1/f9`" = "abcdefghijkl" ] || \
186 error "`od -a $DIR1/f9` != abcdefghijkl"
188 run_test 9 "append of file with sub-page size on multiple mounts"
195 for C in a b c d e f g h i j k l; do
196 dir=`eval echo \\$DIR$MTPT`
197 echo -n $C | dd of=$dir/f10 bs=1 seek=$OFFSET count=1
198 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
199 OFFSET=`expr $OFFSET + 1`
201 [ "`cat $DIR1/f10`" = "abcdefghijkl" ] || \
202 error "`od -a $DIR1/f10` != abcdefghijkl"
204 run_test 10a "write of file with sub-page size on multiple mounts "
208 yes "R" | head -c 4000 >$TMP/f10b-seed
209 dd if=$TMP/f10b-seed of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1"
211 $TRUNCATE $DIR1/f10b 4096 || error "truncate 4096"
213 dd if=$DIR2/f10b of=$TMP/f10b-lustre bs=4k count=1 || error "dd $DIR2"
215 # create a test file locally to compare
216 dd if=$TMP/f10b-seed of=$TMP/f10b bs=3k count=1 || error "dd random"
217 $TRUNCATE $TMP/f10b 4096 || error "truncate 4096"
218 cmp $TMP/f10b $TMP/f10b-lustre || error "file miscompare"
219 rm $TMP/f10b $TMP/f10b-lustre $TMP/f10b-seed
221 run_test 10b "write of file with sub-page size on multiple mounts "
225 multiop_bg_pause $DIR1/d11/f O_c || return 1
227 cp -p /bin/ls $DIR1/d11/f
231 wait $MULTIPID || error
232 [ $RC -eq 0 ] && error || true
234 run_test 11 "execution of file opened for write should return error ===="
237 DIR=$DIR DIR2=$DIR2 sh lockorder.sh
239 run_test 12 "test lock ordering (link, stat, unlink) ==========="
241 test_13() { # bug 2451 - directory coherency
242 mkdir $DIR1/d13 || error
243 cd $DIR1/d13 || error
245 ( touch $DIR1/d13/f13 ) # needs to be a separate shell
247 rm -f $DIR2/d13/f13 || error
248 ls 2>&1 | grep f13 && error "f13 shouldn't return an error (1)" || true
249 # need to run it twice
250 ( touch $DIR1/d13/f13 ) # needs to be a separate shell
252 rm -f $DIR2/d13/f13 || error
253 ls 2>&1 | grep f13 && error "f13 shouldn't return an error (2)" || true
255 run_test 13 "test directory page revocation ===================="
259 cp -p /bin/ls $DIR1/$tdir/$tfile
260 multiop_bg_pause $DIR1/$tdir/$tfile Ow_c || return 1
263 $DIR2/$tdir/$tfile && error || true
265 wait $MULTIPID || return 2
267 run_test 14 "execution of file open for write returns -ETXTBSY ="
271 cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
272 MULTIOP_PROG=$DIR1/d14/multiop multiop_bg_pause $TMP/test14.junk O_c || return 1
274 $MULTIOP $DIR2/d14/multiop Oc && error "expected error, got success"
275 kill -USR1 $MULTIOP_PID || return 2
276 wait $MULTIOP_PID || return 3
277 rm $TMP/test14.junk $DIR1/d14/multiop || error "removing multiop"
279 run_test 14a "open(RDWR) of executing file returns -ETXTBSY ===="
281 test_14b() { # bug 3192, 7040
283 cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
284 MULTIOP_PROG=$DIR1/d14/multiop multiop_bg_pause $TMP/test14.junk O_c || return 1
286 $TRUNCATE $DIR2/d14/multiop 0 && kill -9 $MULTIOP_PID && \
287 error "expected truncate error, got success"
288 kill -USR1 $MULTIOP_PID || return 2
289 wait $MULTIOP_PID || return 3
290 cmp `which multiop` $DIR1/d14/multiop || error "binary changed"
291 rm $TMP/test14.junk $DIR1/d14/multiop || error "removing multiop"
293 run_test 14b "truncate of executing file returns -ETXTBSY ======"
295 test_14c() { # bug 3430, 7040
297 cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
298 MULTIOP_PROG=$DIR1/d14/multiop multiop_bg_pause $TMP/test14.junk O_c || return 1
300 cp /etc/hosts $DIR2/d14/multiop && error "expected error, got success"
301 kill -USR1 $MULTIOP_PID || return 2
302 wait $MULTIOP_PID || return 3
303 cmp `which multiop` $DIR1/d14/multiop || error "binary changed"
304 rm $TMP/test14.junk $DIR1/d14/multiop || error "removing multiop"
306 run_test 14c "open(O_TRUNC) of executing file return -ETXTBSY =="
308 test_14d() { # bug 10921
310 cp -p `which multiop` $DIR1/d14/multiop || error "cp failed"
311 MULTIOP_PROG=$DIR1/d14/multiop multiop_bg_pause $TMP/test14.junk O_c || return 1
314 chmod 600 $DIR1/d14/multiop || error "chmod failed"
315 kill -USR1 $MULTIOP_PID || return 2
316 wait $MULTIOP_PID || return 3
317 cmp `which multiop` $DIR1/d14/multiop || error "binary changed"
318 rm $TMP/test14.junk $DIR1/d14/multiop || error "removing multiop"
320 run_test 14d "chmod of executing file is still possible ========"
322 test_15() { # bug 974 - ENOSPC
324 sh oos2.sh $MOUNT1 $MOUNT2
325 wait_delete_completed
326 grant_error=`dmesg | grep "> available"`
327 [ -z "$grant_error" ] || error "$grant_error"
329 run_test 15 "test out-of-space with multiple writers ==========="
332 rm -f $MOUNT1/fsxfile
333 lfs setstripe $MOUNT1/fsxfile -c -1 # b=10919
334 fsx -c 50 -p 100 -N 2500 -l $((SIZE * 256)) -S 0 $FSXOPT \
335 $MOUNT1/fsxfile $MOUNT2/fsxfile
337 run_test 16 "2500 iterations of dual-mount fsx ================="
339 test_17() { # bug 3513, 3667
340 remote_ost_nodsh && skip "remote OST with nodsh" && return
342 lfs setstripe $DIR1/$tfile -i 0 -c 1
343 cp $SAMPLE_FILE $DIR1/$tfile
344 cancel_lru_locks osc > /dev/null
345 #define OBD_FAIL_ONCE|OBD_FAIL_LDLM_CREATE_RESOURCE 0x30a
346 do_facet ost1 lctl set_param fail_loc=0x8000030a
347 ls -ls $DIR1/$tfile | awk '{ print $1,$6 }' > $DIR1/$tfile-1 & \
348 ls -ls $DIR2/$tfile | awk '{ print $1,$6 }' > $DIR2/$tfile-2
350 diff -u $DIR1/$tfile-1 $DIR2/$tfile-2 || error "files are different"
352 run_test 17 "resource creation/LVB creation race ==============="
355 # turn e.g. ALWAYS_EXCEPT="18c" into "-e 3"
358 for idx in {a..z}; do
359 local ptr=EXCEPT_ALWAYS_18$idx
360 [ x${!ptr} = xtrue ] || continue
362 excepts="$excepts -e $(($(printf %d \'$idx)-96))"
365 $LUSTRE/tests/mmap_sanity -d $MOUNT1 -m $MOUNT2 $excepts
368 run_test 18 "mmap sanity check ================================="
370 test_19() { # bug3811
371 [ -d /proc/fs/lustre/obdfilter ] || return 0
373 MAX=`lctl get_param -n obdfilter.*.readcache_max_filesize | head -n 1`
374 lctl set_param -n obdfilter.*OST*.readcache_max_filesize=4096
375 dd if=/dev/urandom of=$TMP/f19b bs=512k count=32
376 SUM=`cksum $TMP/f19b | cut -d" " -f 1,2`
377 cp $TMP/f19b $DIR1/f19b
378 for i in `seq 1 20`; do
379 [ $((i % 5)) -eq 0 ] && log "test_18 loop $i"
380 cancel_lru_locks osc > /dev/null
381 cksum $DIR1/f19b | cut -d" " -f 1,2 > $TMP/sum1 & \
382 cksum $DIR2/f19b | cut -d" " -f 1,2 > $TMP/sum2
384 [ "`cat $TMP/sum1`" = "$SUM" ] || \
385 error "$DIR1/f19b `cat $TMP/sum1` != $SUM"
386 [ "`cat $TMP/sum2`" = "$SUM" ] || \
387 error "$DIR2/f19b `cat $TMP/sum2` != $SUM"
389 lctl set_param -n obdfilter.*OST*.readcache_max_filesize=$MAX
392 run_test 19 "test concurrent uncached read races ==============="
397 CNT=$((`lctl get_param -n llite.*.dump_page_cache | wc -l`))
398 $MULTIOP $DIR1/f20 Ow8190c
399 $MULTIOP $DIR2/f20 Oz8194w8190c
400 $MULTIOP $DIR1/f20 Oz0r8190c
402 CNTD=$((`lctl get_param -n llite.*.dump_page_cache | wc -l` - $CNT))
404 error $CNTD" page left in cache after lock cancel" || true
406 run_test 20 "test extra readahead page left in cache ===="
413 test_21() { # Bug 5907
415 mount /etc $DIR1/d21 --bind || error "mount failed" # Poor man's mount.
417 rmdir -v $DIR1/d21 && error "Removed mounted directory"
418 rmdir -v $DIR2/d21 && echo "Removed mounted directory from another mountpoint, needs to be fixed"
419 test -d $DIR1/d21 || error "Mounted directory disappeared"
421 test -d $DIR2/d21 || test -d $DIR1/d21 && error "Removed dir still visible after umount"
424 run_test 21 " Try to remove mountpoint on another dir ===="
426 test_23() { # Bug 5972
427 echo "others should see updated atime while another read" > $DIR1/f23
429 # clear the lock(mode: LCK_PW) gotten from creating operation
433 #MAX_ATIME_DIFF 60, we update atime only if older than 60 seconds
436 multiop_bg_pause $DIR1/f23 or20_c || return 1
437 # with SOM and opencache enabled, we need to close a file and cancel
438 # open lock to get atime propogated to MDS
442 time2=`stat -c "%X" $DIR2/f23`
444 if (( $time2 <= $time1 )); then
445 error "atime doesn't update among nodes"
448 rm -f $DIR1/f23 || error "rm -f $DIR1/f23 failed"
451 run_test 23 " others should see updated atime while another read===="
455 lfs df || error "lfs df failed"
456 lfs df -ih || error "lfs df -ih failed"
457 lfs df -h $DIR1 || error "lfs df -h $DIR1 failed"
458 lfs df -i $DIR2 || error "lfs df -i $DIR2 failed"
459 lfs df $DIR1/$tfile || error "lfs df $DIR1/$tfile failed"
460 lfs df -ih $DIR2/$tfile || error "lfs df -ih $DIR2/$tfile failed"
462 OSC=`lctl dl | awk '/-osc-|OSC.*MNT/ {print $4}' | head -n 1`
463 # OSC=`lctl dl | awk '/-osc-/ {print $4}' | head -n 1`
464 lctl --device %$OSC deactivate
465 lfs df -i || error "lfs df -i with deactivated OSC failed"
466 lctl --device %$OSC activate
467 lfs df || error "lfs df with reactivated OSC failed"
469 run_test 24a "lfs df [-ih] [path] test ========================="
473 fsnum=`lfs df | grep -c "filesystem summary:"`
474 [ $fsnum -eq 2 ] || error "lfs df shows $fsnum != 2 filesystems."
476 run_test 24b "lfs df should show both filesystems ==============="
479 [ `lctl get_param -n mdc.*-mdc-*.connect_flags | grep -c acl` -lt 2 ] &&
480 skip "must have acl, skipping" && return
483 touch $DIR1/$tdir/f1 || error "touch $DIR1/$tdir/f1"
484 chmod 0755 $DIR1/$tdir/f1 || error "chmod 0755 $DIR1/$tdir/f1"
486 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #1"
487 setfacl -m u:$RUNAS_ID:--- -m g:$RUNAS_GID:--- $DIR1/$tdir ||
488 error "setfacl $DIR2/$tdir #1"
489 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 && error "checkstat $DIR2/$tdir/f1 #2"
490 setfacl -m u:$RUNAS_ID:r-x -m g:$RUNAS_GID:r-x $DIR1/$tdir ||
491 error "setfacl $DIR2/$tdir #2"
492 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #3"
493 setfacl -m u:$RUNAS_ID:--- -m g:$RUNAS_GID:--- $DIR1/$tdir ||
494 error "setfacl $DIR2/$tdir #3"
495 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 && error "checkstat $DIR2/$tdir/f1 #4"
496 setfacl -x u:$RUNAS_ID: -x g:$RUNAS_GID: $DIR1/$tdir ||
497 error "setfacl $DIR2/$tdir #4"
498 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #5"
502 run_test 25 "change ACL on one mountpoint be seen on another ==="
505 utime $DIR1/f26a -s $DIR2/f26a || error
507 run_test 26a "allow mtime to get older"
512 echo "aaa" >> $DIR1/$tfile
514 chmod a+x $DIR2/$tfile
515 mt1=`stat -c %Y $DIR1/$tfile`
516 mt2=`stat -c %Y $DIR2/$tfile`
518 if [ x"$mt1" != x"$mt2" ]; then
519 error "not equal mtime, client1: "$mt1", client2: "$mt2"."
522 run_test 26b "sync mtime between ost and mds"
527 dd if=/dev/zero of=$DIR2/$tfile bs=$((4096+4))k conv=notrunc count=4 seek=3 &
532 dd if=/dev/zero of=$DIR1/$tfile bs=$((16384-1024))k conv=notrunc count=1 seek=4 &
537 dd if=/dev/zero of=$DIR1/$tfile bs=8k conv=notrunc count=1 seek=0
539 lctl set_param -n ldlm.dump_namespaces ""
540 wait $DD1_PID $DD2_PID
541 [ $? -ne 0 ] && lctl dk $TMP/debug || true
543 run_test 27 "align non-overlapping extent locks from request ==="
545 test_28() { # bug 9977
546 ECHO_UUID="ECHO_osc1_UUID"
547 tOST=`$LCTL dl | | awk '/-osc-|OSC.*MNT/ { print $4 }' | head -1`
549 $LFS setstripe $DIR1/$tfile -S 1048576 -i 0 -c 2
550 tOBJID=`$LFS getstripe $DIR1/$tfile | awk '$1 == 1 {print $2}'`
551 dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2
555 attach echo_client ECHO_osc1 $ECHO_UUID
559 tECHOID=`$LCTL dl | grep $ECHO_UUID | awk '{ print $1 }'`
560 $LCTL --device $tECHOID destroy "${tOBJID}:0"
568 # reading of 1st stripe should pass
569 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error
570 # reading of 2nd stripe should fail (this stripe was destroyed)
571 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 && error
573 # now, recreating test file
574 dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2 || error
575 # reading of 1st stripe should pass
576 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error
577 # reading of 2nd stripe should pass
578 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 || error
580 run_test 28 "read/write/truncate file with lost stripes"
582 test_29() { # bug 10999
584 #define OBD_FAIL_LDLM_GLIMPSE 0x30f
585 lctl set_param fail_loc=0x8000030f
588 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1
591 #bug 11549 - permanently turn test off in b1_5
592 run_test 29 "lock put race between glimpse and enqueue ========="
594 test_30() { #bug #11110
596 cp -f /bin/bash $DIR1/$tdir/bash
597 /bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
598 err=$($DIR1/$tdir/bash -c 'sleep 2; openfile -f O_RDONLY /proc/$$/exe >& /dev/null; echo $?')
600 [ $err -ne 116 ] && error_ignore 12900 "return code ($err) != -ESTALE" && return
604 run_test 30 "recreate file race ========="
607 mkdir -p $DIR1/$tdir || error "Creating dir $DIR1/$tdir"
608 writes=`LANG=C dd if=/dev/zero of=$DIR/$tdir/$tfile count=1 2>&1 |
609 awk 'BEGIN { FS="+" } /out/ {print $1}'`
610 #define OBD_FAIL_LDLM_CANCEL_BL_CB_RACE 0x314
611 lctl set_param fail_loc=0x314
612 reads=`LANG=C dd if=$DIR2/$tdir/$tfile of=/dev/null 2>&1 |
613 awk 'BEGIN { FS="+" } /in/ {print $1}'`
614 [ $reads -eq $writes ] || error "read" $reads "blocks, must be" $writes
616 run_test 31a "voluntary cancel / blocking ast race=============="
619 remote_ost || { skip "local OST" && return 0; }
620 remote_ost_nodsh && skip "remote OST w/o dsh" && return 0
622 # make sure there is no local locks due to destroy
623 wait_mds_ost_sync || error "wait_mds_ost_sync()"
624 wait_delete_completed || error "wait_delete_completed()"
626 mkdir -p $DIR1/$tdir || error "Creating dir $DIR1/$tdir"
627 lfs setstripe $DIR/$tdir/$tfile -i 0 -c 1
628 cp /etc/hosts $DIR/$tdir/$tfile
629 #define OBD_FAIL_LDLM_CANCEL_BL_CB_RACE 0x314
630 lctl set_param fail_loc=0x314
631 #define OBD_FAIL_LDLM_OST_FAIL_RACE 0x316
632 do_facet ost1 lctl set_param fail_loc=0x316
634 cat $DIR2/$tdir/$tfile > /dev/null 2>&1
635 lctl set_param fail_loc=0
636 do_facet ost1 lctl set_param fail_loc=0
637 # cleanup: reconnect the client back
640 run_test 31b "voluntary OST cancel / blocking ast race=============="
642 # enable/disable lockless truncate feature, depending on the arg 0/1
643 enable_lockless_truncate() {
644 lctl set_param -n osc.*.lockless_truncate $1
647 test_32a() { # bug 11270
648 local p="$TMP/sanityN-$TESTNAME.parameters"
649 save_lustre_params $HOSTNAME osc.*.lockless_truncate > $p
651 enable_lockless_truncate 1
653 lfs setstripe -c -1 $DIR1/$tfile
654 dd if=/dev/zero of=$DIR1/$tfile count=$OSTCOUNT bs=$STRIPE_BYTES > \
658 log "checking cached lockless truncate"
659 $TRUNCATE $DIR1/$tfile 8000000
660 $CHECKSTAT -s 8000000 $DIR2/$tfile || error "wrong file size"
661 [ $(calc_osc_stats lockless_truncate) -eq 0 ] ||
662 error "lockless truncate doesn't use cached locks"
664 log "checking not cached lockless truncate"
665 $TRUNCATE $DIR2/$tfile 5000000
666 $CHECKSTAT -s 5000000 $DIR1/$tfile || error "wrong file size"
667 [ $(calc_osc_stats lockless_truncate) -ne 0 ] ||
668 error "not cached trancate isn't lockless"
670 log "disabled lockless truncate"
671 enable_lockless_truncate 0
673 $TRUNCATE $DIR2/$tfile 3000000
674 $CHECKSTAT -s 3000000 $DIR1/$tfile || error "wrong file size"
675 [ $(calc_osc_stats lockless_truncate) -eq 0 ] ||
676 error "lockless truncate disabling failed"
678 # restore lockless_truncate default values
679 restore_lustre_params < $p
682 run_test 32a "lockless truncate"
684 test_32b() { # bug 11270
685 remote_ost_nodsh && skip "remote OST with nodsh" && return
688 local p="$TMP/sanityN-$TESTNAME.parameters"
689 save_lustre_params $HOSTNAME "osc.*.contention_seconds" > $p
690 for node in $(osts_nodes); do
691 save_lustre_params $node "ldlm.namespaces.filter-*.max_nolock_bytes" >> $p
692 save_lustre_params $node "ldlm.namespaces.filter-*.contended_locks" >> $p
693 save_lustre_params $node "ldlm.namespaces.filter-*.contention_seconds" >> $p
696 # agressive lockless i/o settings
697 for node in $(osts_nodes); do
698 do_node $node 'lctl set_param -n ldlm.namespaces.filter-*.max_nolock_bytes 2000000; lctl set_param -n ldlm.namespaces.filter-*.contended_locks 0; lctl set_param -n ldlm.namespaces.filter-*.contention_seconds 60'
700 lctl set_param -n osc.*.contention_seconds 60
701 for i in $(seq 5); do
702 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
703 dd if=/dev/zero of=$DIR2/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
705 [ $(calc_osc_stats lockless_write_bytes) -ne 0 ] || error "lockless i/o was not triggered"
706 # disable lockless i/o (it is disabled by default)
707 for node in $(osts_nodes); do
708 do_node $node 'lctl set_param -n ldlm.namespaces.filter-*.max_nolock_bytes 0; lctl set_param -n ldlm.namespaces.filter-*.contended_locks 32; lctl set_param -n ldlm.namespaces.filter-*.contention_seconds 0'
710 # set contention_seconds to 0 at client too, otherwise Lustre still
711 # remembers lock contention
712 lctl set_param -n osc.*.contention_seconds 0
714 for i in $(seq 1); do
715 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
716 dd if=/dev/zero of=$DIR2/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
718 [ $(calc_osc_stats lockless_write_bytes) -eq 0 ] ||
719 error "lockless i/o works when disabled"
721 restore_lustre_params <$p
724 run_test 32b "lockless i/o"
728 local mdts=$(get_facets MDS)
733 for mds in ${mdts//,/ }; do
735 dev=$(basename $(do_facet $mds lctl get_param -n osd*.${!varsvc}.mntdev))
736 val=$(do_facet $mds "procfile=/proc/fs/jbd/$dev/info;
737 [ -f \\\$procfile ] || procfile=/proc/fs/jbd2/$dev/info;
738 [ -f \\\$procfile ] || procfile=/proc/fs/jbd2/${dev}\:\\\*/info;
739 cat \\\$procfile | head -1;")
741 stat=$(( stat + val))
746 # commit on sharing tests
748 remote_mds_nodsh && skip "remote MDS with nodsh" && return
750 [ -n "$CLIENTS" ] || { skip "Need two or more clients" && return 0; }
751 [ $CLIENTCOUNT -ge 2 ] || \
752 { skip "Need two or more clients, have $CLIENTCOUNT" && return 0; }
754 local nfiles=${TEST33_NFILES:-10000}
755 local param_file=$TMP/$tfile-params
757 save_lustre_params $(comma_list $(mdts_nodes)) "mdt.*.commit_on_sharing" > $param_file
765 do_facet $SINGLEMDS lctl set_param mdt.*.commit_on_sharing=$COS
769 do_nodes $CLIENT1,$CLIENT2 "mkdir -p $DIR1/$tdir-\\\$(hostname)-$i"
771 jbdold=$(print_jbd_stat)
772 echo "=== START createmany old: $jbdold transaction"
773 local elapsed=$(do_and_time "do_nodes $CLIENT1,$CLIENT2 createmany -o $DIR1/$tdir-\\\$(hostname)-$i/f- -r $DIR2/$tdir-\\\$(hostname)-$i/f- $nfiles > /dev/null 2>&1")
774 jbdnew=$(print_jbd_stat)
775 jbd=$(( jbdnew - jbdold ))
776 echo "=== END createmany new: $jbdnew transaction : $jbd transactions nfiles $nfiles time $elapsed COS=$COS"
777 avgjbd=$(( avgjbd + jbd ))
778 avgtime=$(( avgtime + elapsed ))
780 eval cos${COS}_jbd=$((avgjbd / 3))
781 eval cos${COS}_time=$((avgtime / 3))
784 echo "COS=0 transactions (avg): $cos0_jbd time (avg): $cos0_time"
785 echo "COS=1 transactions (avg): $cos1_jbd time (avg): $cos1_time"
786 [ "$cos0_jbd" != 0 ] && echo "COS=1 vs COS=0 jbd: $((((cos1_jbd/cos0_jbd - 1)) * 100 )) %"
787 [ "$cos0_time" != 0 ] && echo "COS=1 vs COS=0 time: $((((cos1_time/cos0_time - 1)) * 100 )) %"
789 restore_lustre_params < $param_file
793 run_test 33a "commit on sharing, cross crete/delete, 2 clients, benchmark"
795 # End commit on sharing tests
797 get_ost_lock_timeouts() {
798 local nodes=${1:-$(comma_list $(osts_nodes))}
800 local locks=$(do_nodes $nodes \
801 "lctl get_param -n ldlm.namespaces.filter-*.lock_timeouts" | calc_sum)
810 for OPER in notimeout timeout ; do
811 rm $DIR1/$tfile 2>/dev/null
812 lock_in=$(get_ost_lock_timeouts)
813 if [ $OPER == "timeout" ] ; then
814 for j in `seq $OSTCOUNT`; do
815 #define OBD_FAIL_PTLRPC_HPREQ_TIMEOUT 0x511
816 do_facet ost$j lctl set_param fail_loc=0x511
818 echo lock should expire
820 for j in `seq $OSTCOUNT`; do
821 #define OBD_FAIL_PTLRPC_HPREQ_NOTIMEOUT 0x512
822 do_facet ost$j lctl set_param fail_loc=0x512
824 echo lock should not expire
826 echo writing on client1
827 dd if=/dev/zero of=$DIR1/$tfile count=100 conv=notrunc > /dev/null 2>&1
829 echo reading on client2
830 dd of=/dev/null if=$DIR2/$tfile > /dev/null 2>&1
831 # wait for a lock timeout
833 lock_out=$(get_ost_lock_timeouts)
834 if [ $OPER == "timeout" ] ; then
835 if [ $lock_in == $lock_out ]; then
836 error "no lock timeout happened"
841 if [ $lock_in != $lock_out ]; then
842 error "lock timeout happened"
849 run_test 34 "no lock timeout under IO"
851 test_35() { # bug 17645
854 for imp in /proc/fs/lustre/mdc/$FSNAME-MDT*-mdc-*; do
855 g=$(awk '/generation/{print $2}' $imp/import)
860 mkdir -p $MOUNT1/$tfile
863 # Let's initiate -EINTR situation by setting fail_loc and take
864 # write lock on same file from same client. This will not cause
865 # bl_ast yet as lock is already in local cache.
866 #define OBD_FAIL_LDLM_INTR_CP_AST 0x317
867 do_facet client "lctl set_param fail_loc=0x80000317"
868 local timeout=`do_facet $SINGLEMDS lctl get_param -n timeout`
869 let timeout=timeout*3
871 while test $nr -lt 10; do
872 log "Race attempt $nr"
873 local blk1=`lctl get_param -n ldlm.services.ldlm_cbd.stats | awk '/ldlm_bl_callback/ {print $2}'`
874 test "x$blk1" = "x" && blk1=0
875 createmany -o $MOUNT2/$tfile/a 4000 &
879 # Let's make conflict and bl_ast
880 ls -la $MOUNT1/$tfile > /dev/null &
883 log "Wait for $pid1 $pid2 for $timeout sec..."
885 kill -9 $pid1 $pid2 > /dev/null 2>&1
887 local blk2=`lctl get_param -n ldlm.services.ldlm_cbd.stats | awk '/ldlm_bl_callback/ {print $2}'`
888 test "x$blk2" = "x" && blk2=0
889 test $blk2 -gt $blk1 && break
890 rm -fr $MOUNT1/$tfile/*
894 do_facet client "lctl set_param fail_loc=0x0"
895 df -h $MOUNT1 $MOUNT2
897 for imp in /proc/fs/lustre/mdc/$FSNAME-MDT*-mdc-*; do
898 g=$(awk '/generation/{print $2}' $imp/import)
899 if ! test "$g" -eq "${generation[count]}"; then
900 error "Eviction happened on import $(basename $imp)"
905 run_test 35 "-EINTR cp_ast vs. bl_ast race does not evict client"
907 test_36() { #bug 16417
913 $LFS setstripe -c -1 $DIR1/$tdir
916 let SIZE_B=SIZE*1024*1024
918 while [ $i -le 10 ]; do
919 lctl mark "start test"
920 local before=$($LFS df | awk '{if ($1 ~/^filesystem/) \
922 dd if=/dev/zero of=$DIR1/$tdir/file000 bs=1M count=$SIZE
923 sync # sync data from client's cache
924 sync_all_data # sync data from server's cache (delayed
927 local after_dd=$($LFS df | awk '{if ($1 ~/^filesystem/) \
929 multiop_bg_pause $DIR2/$tdir/file000 O_r${SIZE_B}c || return 3
931 rm -f $DIR1/$tdir/file000
934 wait_delete_completed
935 local after=$($LFS df | awk '{if ($1 ~/^filesystem/) \
937 echo "*** cycle($i) *** before($before) after_dd($after_dd)" \
939 # this free space! not used
940 if [ $after_dd -ge $after ]; then
947 run_test 36 "handle ESTALE/open-unlink corectly"
949 test_37() { # bug 18695
951 multiop_bg_pause $DIR1/$tdir D_c || return 1
953 # create large directory (32kB seems enough from e2fsck, ~= 1000 files)
954 createmany -m $DIR2/$tdir/f 10000
955 # set mtime/atime backward
956 touch -t 198001010000 $DIR2/$tdir
958 nr_files=`lfs find $DIR1/$tdir -type f | wc -l`
959 [ $nr_files -eq 10000 ] || error "$nr_files != 10000 truncated directory?"
962 run_test 37 "check i_size is not updated for directory on close (bug 18695) =============="
964 # this should be set to past
965 TEST_39_MTIME=`date -d "1 year ago" +%s`
969 local client1=${CLIENT1:-`hostname`}
970 local client2=${CLIENT2:-`hostname`}
972 do_node $client1 "touch $DIR1/$tfile"
974 do_node $client1 "touch -m -d @$TEST_39_MTIME $DIR1/$tfile"
975 local mtime1=`do_node $client2 "stat -c %Y $DIR1/$tfile"`
976 [ "$mtime1" = $TEST_39_MTIME ] || \
977 error "mtime is not set to past: $mtime1, should be $TEST_39_MTIME"
979 local d1=`do_node $client1 date +%s`
980 do_node $client1 'echo hello >> '$DIR1/$tfile
981 local d2=`do_node $client1 date +%s`
983 local mtime2=`do_node $client2 "stat -c %Y $DIR1/$tfile"`
984 [ "$mtime2" -ge "$d1" ] && [ "$mtime2" -le "$d2" ] || \
985 error "mtime is not updated on write: $d1 <= $mtime2 <= $d2"
987 do_node $client1 "mv $DIR1/$tfile $DIR1/$tfile-1"
989 for (( i=0; i < 2; i++ )) ; do
990 local mtime3=`do_node $client2 "stat -c %Y $DIR1/$tfile-1"`
991 [ "$mtime2" = "$mtime3" ] || \
992 error "mtime ($mtime2) changed (to $mtime3) on rename"
995 if [ $i = 0 ] ; then echo "repeat after cancel_lru_locks"; fi
998 run_test 39a "test from 11063 =================================="
1001 local client1=${CLIENT1:-`hostname`}
1002 local client2=${CLIENT2:-`hostname`}
1006 local mtime1=`stat -c %Y $DIR1/$tfile`
1007 local mtime2=`do_node $client2 "stat -c %Y $DIR1/$tfile"`
1010 touch -m -d @$TEST_39_MTIME $DIR1/$tfile
1012 for (( i=0; i < 2; i++ )) ; do
1013 local mtime3=`stat -c %Y $DIR1/$tfile`
1014 local mtime4=`do_node $client2 "stat -c %Y $DIR1/$tfile"`
1016 [ "$mtime3" = "$mtime4" ] || \
1017 error "different mtime on clients: $mtime3, $mtime4"
1018 [ "$mtime3" = $TEST_39_MTIME ] || \
1019 error "lost mtime: $mtime3, should be $TEST_39_MTIME"
1021 cancel_lru_locks osc
1022 if [ $i = 0 ] ; then echo "repeat after cancel_lru_locks"; fi
1025 run_test 39b "11063 problem 1 =================================="
1028 local client1=${CLIENT1:-`hostname`}
1029 local client2=${CLIENT2:-`hostname`}
1031 echo hello > $DIR1/$tfile
1033 local mtime1=`stat -c %Y $DIR1/$tfile`
1034 local mtime2=`do_node $client2 "stat -c %Y $DIR1/$tfile"`
1035 [ "$mtime1" = "$mtime2" ] || \
1036 error "create: different mtime on clients: $mtime1, $mtime2"
1039 $TRUNCATE $DIR1/$tfile 1
1041 for (( i=0; i < 2; i++ )) ; do
1042 local mtime3=`stat -c %Y $DIR1/$tfile`
1043 local mtime4=`do_node $client2 "stat -c %Y $DIR1/$tfile"`
1045 [ "$mtime3" = "$mtime4" ] || \
1046 error "different mtime on clients: $mtime3, $mtime4"
1047 [ "$mtime3" -gt $mtime2 ] || \
1048 error "truncate did not update mtime: $mtime2, $mtime3"
1050 cancel_lru_locks osc
1051 if [ $i = 0 ] ; then echo "repeat after cancel_lru_locks"; fi
1054 run_test 39c "check truncate mtime update ======================"
1056 # check that pid exists hence second operation wasn't blocked by first one
1057 # if it is so then there is no conflict, return 0
1058 # else second operation is conflicting with first one, return 1
1059 check_pdo_conflict() {
1062 sleep 1 # to ensure OP1 is finished on client if OP2 is blocked by OP1
1063 if [[ `ps --pid $pid | wc -l` == 1 ]]; then
1073 # test 40: check non-blocking operations
1075 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1076 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1077 mkdir $DIR1/$tfile &
1080 touch $DIR2/$tfile-2
1081 check_pdo_conflict $PID1 || error "create is blocked"
1082 mkdir $DIR2/$tfile-3
1083 check_pdo_conflict $PID1 || error "mkdir is blocked"
1084 link $DIR2/$tfile-2 $DIR2/$tfile-4
1085 check_pdo_conflict $PID1 || error "link is blocked"
1086 mv $DIR2/$tfile-2 $DIR2/$tfile-5
1087 check_pdo_conflict $PID1 || error "rename is blocked"
1088 stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
1089 check_pdo_conflict $PID1 || error "getattr is blocked"
1090 rm $DIR2/$tfile-4 $DIR2/$tfile-5
1091 rmdir $DIR2/$tfile-3
1092 check_pdo_conflict $PID1 || error "unlink is blocked"
1093 # all operations above shouldn't wait the first one
1094 check_pdo_conflict $PID1 || error "parallel operation is blocked"
1099 run_test 40a "pdirops: create vs others =============="
1102 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1103 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1104 touch $DIR1/$tfile &
1108 touch $DIR2/$tfile-2
1109 check_pdo_conflict $PID1 || error "create is blocked"
1110 mkdir $DIR2/$tfile-3
1111 check_pdo_conflict $PID1 || error "mkdir is blocked"
1112 link $DIR2/$tfile-2 $DIR2/$tfile-4
1113 check_pdo_conflict $PID1 || error "link is blocked"
1114 mv $DIR2/$tfile-2 $DIR2/$tfile-5
1115 check_pdo_conflict $PID1 || error "rename is blocked"
1116 stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
1117 check_pdo_conflict $PID1 || error "getattr is blocked"
1118 rm $DIR2/$tfile-4 $DIR2/$tfile-5
1119 rmdir $DIR2/$tfile-3
1120 check_pdo_conflict $PID1 || error "unlink is blocked"
1121 # all operations above shouldn't wait the first one
1122 check_pdo_conflict $PID1 || error "parallel operation is blocked"
1127 run_test 40b "pdirops: open|create and others =============="
1131 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1132 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1133 link $DIR1/$tfile $DIR1/$tfile-0 &
1137 touch $DIR2/$tfile-2
1138 check_pdo_conflict $PID1 || error "create is blocked"
1139 mkdir $DIR2/$tfile-3
1140 check_pdo_conflict $PID1 || error "mkdir is blocked"
1141 link $DIR2/$tfile-2 $DIR2/$tfile-4
1142 check_pdo_conflict $PID1 || error "link is blocked"
1143 mv $DIR2/$tfile-2 $DIR2/$tfile-5
1144 check_pdo_conflict $PID1 || error "rename is blocked"
1145 stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
1146 check_pdo_conflict $PID1 || error "getattr is blocked"
1147 rm $DIR2/$tfile-4 $DIR2/$tfile-5
1148 rmdir $DIR2/$tfile-3
1149 check_pdo_conflict $PID1 || error "unlink is blocked"
1150 # all operations above shouldn't wait the first one
1151 check_pdo_conflict $PID1 || error "parallel operation is blocked"
1156 run_test 40c "pdirops: link and others =============="
1160 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1161 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1166 touch $DIR2/$tfile-2
1167 check_pdo_conflict $PID1 || error "create is blocked"
1168 mkdir $DIR2/$tfile-3
1169 check_pdo_conflict $PID1 || error "mkdir is blocked"
1170 link $DIR2/$tfile-2 $DIR2/$tfile-4
1171 check_pdo_conflict $PID1 || error "link is blocked"
1172 mv $DIR2/$tfile-2 $DIR2/$tfile-5
1173 check_pdo_conflict $PID1 || error "rename is blocked"
1174 stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
1175 check_pdo_conflict $PID1 || error "getattr is blocked"
1176 rm $DIR2/$tfile-4 $DIR2/$tfile-5
1177 rmdir $DIR2/$tfile-3
1178 check_pdo_conflict $PID1 || error "unlink is blocked"
1179 # all operations above shouldn't wait the first one
1180 check_pdo_conflict $PID1 || error "parallel operation is blocked"
1184 run_test 40d "pdirops: unlink and others =============="
1188 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1189 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1190 mv $DIR1/$tfile $DIR1/$tfile-0 &
1194 touch $DIR2/$tfile-2
1195 check_pdo_conflict $PID1 || error "create is blocked"
1196 mkdir $DIR2/$tfile-3
1197 check_pdo_conflict $PID1 || error "mkdir is blocked"
1198 link $DIR2/$tfile-2 $DIR2/$tfile-4
1199 check_pdo_conflict $PID1 || error "link is blocked"
1200 stat $DIR2/$tfile-3 $DIR2/$tfile-4 > /dev/null
1201 check_pdo_conflict $PID1 || error "getattr is blocked"
1202 rm $DIR2/$tfile-4 $DIR2/$tfile-2
1203 rmdir $DIR2/$tfile-3
1204 check_pdo_conflict $PID1 || error "unlink is blocked"
1205 # all operations above shouldn't wait the first one
1206 check_pdo_conflict $PID1 || error "parallel operation is blocked"
1211 run_test 40e "pdirops: rename and others =============="
1213 # test 41: create blocking operations
1215 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1216 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1217 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1220 mkdir $DIR2/$tfile && error "mkdir must fail"
1221 check_pdo_conflict $PID1 && { wait $PID1; echo "mkdir isn't blocked"; }
1225 run_test 41a "pdirops: create vs mkdir =============="
1228 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1229 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1230 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1233 $MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c && error "create must fail"
1234 check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
1238 run_test 41b "pdirops: create vs create =============="
1241 touch $DIR1/$tfile-2
1242 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1243 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1244 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1247 link $DIR2/$tfile-2 $DIR2/$tfile && error "link must fail"
1248 check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
1252 run_test 41c "pdirops: create vs link =============="
1255 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1256 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1257 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1260 rm $DIR2/$tfile || error "unlink must succeed"
1261 check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
1265 run_test 41d "pdirops: create vs unlink =============="
1268 touch $DIR1/$tfile-2
1269 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1270 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1271 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1274 mv $DIR2/$tfile-2 $DIR2/$tfile || error "rename must succeed"
1275 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1279 run_test 41e "pdirops: create and rename (tgt) =============="
1282 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1283 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1284 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1287 mv $DIR2/$tfile $DIR2/$tfile-2 || error "rename must succeed"
1288 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1292 run_test 41f "pdirops: create and rename (src) =============="
1295 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1296 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1297 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1300 stat $DIR2/$tfile > /dev/null || error "stat must succeed"
1301 check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
1305 run_test 41g "pdirops: create vs getattr =============="
1308 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1309 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1310 $MULTIOP $DIR1/$tfile oO_CREAT:O_RDWR:c &
1313 ls -lia $DIR2/ > /dev/null
1314 check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
1318 run_test 41h "pdirops: create vs readdir =============="
1320 # test 42: unlink and blocking operations
1322 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1323 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1324 mkdir $DIR1/$tfile &
1327 mkdir $DIR2/$tfile && error "mkdir must fail"
1328 check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
1332 run_test 42a "pdirops: mkdir vs mkdir =============="
1335 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1336 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1337 mkdir $DIR1/$tfile &
1340 $MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c && error "create must fail"
1341 check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
1345 run_test 42b "pdirops: mkdir vs create =============="
1348 touch $DIR1/$tfile-2
1349 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1350 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1351 mkdir $DIR1/$tfile &
1354 link $DIR2/$tfile-2 $DIR2/$tfile && error "link must fail"
1355 check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
1359 run_test 42c "pdirops: mkdir vs link =============="
1362 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1363 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1364 mkdir $DIR1/$tfile &
1367 rmdir $DIR2/$tfile || error "unlink must succeed"
1368 check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
1372 run_test 42d "pdirops: mkdir vs unlink =============="
1375 touch $DIR1/$tfile-2
1376 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1377 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1378 mkdir $DIR1/$tfile &
1381 mv -T $DIR2/$tfile-2 $DIR2/$tfile && error "rename must fail"
1382 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1386 run_test 42e "pdirops: mkdir and rename (tgt) =============="
1389 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1390 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1391 mkdir $DIR1/$tfile &
1394 mv $DIR2/$tfile $DIR2/$tfile-2 || error "rename must succeed"
1395 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1399 run_test 42f "pdirops: mkdir and rename (src) =============="
1402 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1403 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1404 mkdir $DIR1/$tfile &
1407 stat $DIR2/$tfile > /dev/null || error "stat must succeed"
1408 check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
1412 run_test 42g "pdirops: mkdir vs getattr =============="
1415 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1416 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1417 mkdir $DIR1/$tfile &
1420 ls -lia $DIR2/ > /dev/null
1421 check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
1425 run_test 42h "pdirops: mkdir vs readdir =============="
1427 # test 43: unlink and blocking operations
1430 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1431 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1435 mkdir $DIR2/$tfile || error "mkdir must succeed"
1436 check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
1440 run_test 43a "pdirops: unlink vs mkdir =============="
1444 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1445 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1449 $MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c || error "create must succeed"
1450 check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
1454 run_test 43b "pdirops: unlink vs create =============="
1458 touch $DIR1/$tfile-2
1459 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1460 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1464 link $DIR2/$tfile-2 $DIR2/$tfile || error "link must succeed"
1465 check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
1469 run_test 43c "pdirops: unlink vs link =============="
1473 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1474 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1478 rm $DIR2/$tfile && error "unlink must fail"
1479 check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
1483 run_test 43d "pdirops: unlink vs unlink =============="
1487 touch $DIR1/$tfile-2
1488 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1489 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1493 mv -u $DIR2/$tfile-2 $DIR2/$tfile || error "rename must succeed"
1494 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1498 run_test 43e "pdirops: unlink and rename (tgt) =============="
1502 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1503 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1507 mv $DIR2/$tfile $DIR2/$tfile-2 && error "rename must fail"
1508 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1512 run_test 43f "pdirops: unlink and rename (src) =============="
1516 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1517 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1521 stat $DIR2/$tfile > /dev/null && error "stat must fail"
1522 check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
1526 run_test 43g "pdirops: unlink vs getattr =============="
1530 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1531 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1535 ls -lia $DIR2/ > /dev/null
1536 check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
1540 run_test 43h "pdirops: unlink vs readdir =============="
1542 # test 44: rename tgt and blocking operations
1544 touch $DIR1/$tfile-2
1545 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1546 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1547 mv $DIR1/$tfile-2 $DIR1/$tfile &
1550 mkdir $DIR2/$tfile && error "mkdir must fail"
1551 check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
1555 run_test 44a "pdirops: rename tgt vs mkdir =============="
1558 touch $DIR1/$tfile-2
1559 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1560 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1561 mv $DIR1/$tfile-2 $DIR1/$tfile &
1564 $MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c && error "create must fail"
1565 check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
1569 run_test 44b "pdirops: rename tgt vs create =============="
1572 touch $DIR1/$tfile-2
1573 touch $DIR1/$tfile-3
1574 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1575 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1576 mv $DIR1/$tfile-2 $DIR1/$tfile &
1579 link $DIR2/$tfile-3 $DIR2/$tfile && error "link must fail"
1580 check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
1584 run_test 44c "pdirops: rename tgt vs link =============="
1587 touch $DIR1/$tfile-2
1588 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1589 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1590 mv $DIR1/$tfile-2 $DIR1/$tfile &
1593 rm $DIR2/$tfile || error "unlink must succeed"
1594 check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
1598 run_test 44d "pdirops: rename tgt vs unlink =============="
1602 touch $DIR1/$tfile-2
1603 touch $DIR1/$tfile-3
1604 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1605 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1606 mv $DIR1/$tfile-2 $DIR1/$tfile &
1609 mv $DIR2/$tfile-3 $DIR2/$tfile || error "rename must succeed"
1610 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1614 run_test 44e "pdirops: rename tgt and rename (tgt) =============="
1617 touch $DIR1/$tfile-2
1618 touch $DIR1/$tfile-3
1619 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1620 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1621 mv $DIR1/$tfile-2 $DIR1/$tfile &
1624 mv $DIR2/$tfile $DIR2/$tfile-3 || error "rename must succeed"
1625 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1629 run_test 44f "pdirops: rename tgt and rename (src) =============="
1632 touch $DIR1/$tfile-2
1633 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1634 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1635 mv $DIR1/$tfile-2 $DIR1/$tfile &
1638 stat $DIR2/$tfile > /dev/null || error "stat must succeed"
1639 check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
1643 run_test 44g "pdirops: rename tgt vs getattr =============="
1646 touch $DIR1/$tfile-2
1647 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK2 0x146
1648 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000146
1649 mv $DIR1/$tfile-2 $DIR1/$tfile &
1652 ls -lia $DIR2/ > /dev/null
1653 check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
1657 run_test 44h "pdirops: rename tgt vs readdir =============="
1659 # test 45: rename src and blocking operations
1662 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1663 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1664 mv $DIR1/$tfile $DIR1/$tfile-2 &
1667 mkdir $DIR2/$tfile || error "mkdir must succeed"
1668 check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
1672 run_test 45a "pdirops: rename src vs mkdir =============="
1676 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1677 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1678 mv $DIR1/$tfile $DIR1/$tfile-2 &
1681 $MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c || error "create must succeed"
1682 check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
1686 run_test 45b "pdirops: rename src vs create =============="
1690 touch $DIR1/$tfile-3
1691 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1692 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1693 mv $DIR1/$tfile $DIR1/$tfile-2 &
1696 link $DIR2/$tfile-3 $DIR2/$tfile || error "link must succeed"
1697 check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
1701 run_test 45c "pdirops: rename src vs link =============="
1705 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1706 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1707 mv $DIR1/$tfile $DIR1/$tfile-2 &
1710 rm $DIR2/$tfile && error "unlink must fail"
1711 check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
1715 run_test 45d "pdirops: rename src vs unlink =============="
1719 touch $DIR1/$tfile-3
1720 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1721 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1722 mv $DIR1/$tfile $DIR1/$tfile-2 &
1725 mv $DIR2/$tfile-3 $DIR2/$tfile || error "rename must succeed"
1726 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1730 run_test 45e "pdirops: rename src and rename (tgt) =============="
1734 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1735 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1736 mv $DIR1/$tfile $DIR1/$tfile-2 &
1739 mv $DIR2/$tfile $DIR2/$tfile-3 && error "rename must fail"
1740 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1744 run_test 45f "pdirops: rename src and rename (src) =============="
1748 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1749 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1750 mv $DIR1/$tfile $DIR1/$tfile-2 &
1753 stat $DIR2/$tfile > /dev/null && "stat must fail"
1754 check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
1758 run_test 45g "pdirops: rename src vs getattr =============="
1762 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1763 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1764 mv $DIR1/$tfile $DIR1/$tfile-2 &
1767 ls -lia $DIR2/ > /dev/null
1768 check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
1772 run_test 45h "pdirops: unlink vs readdir =============="
1774 # test 46: link and blocking operations
1776 touch $DIR1/$tfile-2
1777 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1778 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1779 link $DIR1/$tfile-2 $DIR1/$tfile &
1782 mkdir $DIR2/$tfile && error "mkdir must fail"
1783 check_pdo_conflict $PID1 && { wait $PID1; error "mkdir isn't blocked"; }
1787 run_test 46a "pdirops: link vs mkdir =============="
1790 touch $DIR1/$tfile-2
1791 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1792 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1793 link $DIR1/$tfile-2 $DIR1/$tfile &
1796 $MULTIOP $DIR2/$tfile oO_CREAT:O_EXCL:c && error "create must fail"
1797 check_pdo_conflict $PID1 && { wait $PID1; error "create isn't blocked"; }
1801 run_test 46b "pdirops: link vs create =============="
1804 touch $DIR1/$tfile-2
1805 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1806 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1807 link $DIR1/$tfile-2 $DIR1/$tfile &
1810 link $DIR2/$tfile $DIR2/$tfile && error "link must fail"
1811 check_pdo_conflict $PID1 && { wait $PID1; error "link isn't blocked"; }
1815 run_test 46c "pdirops: link vs link =============="
1818 touch $DIR1/$tfile-2
1819 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1820 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1821 link $DIR1/$tfile-2 $DIR1/$tfile &
1824 rm $DIR2/$tfile || error "unlink must succeed"
1825 check_pdo_conflict $PID1 && { wait $PID1; error "unlink isn't blocked"; }
1829 run_test 46d "pdirops: link vs unlink =============="
1832 touch $DIR1/$tfile-2
1833 touch $DIR1/$tfile-3
1834 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1835 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1836 link $DIR1/$tfile-2 $DIR1/$tfile &
1839 mv $DIR2/$tfile-3 $DIR2/$tfile || error "rename must succeed"
1840 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1844 run_test 46e "pdirops: link and rename (tgt) =============="
1847 touch $DIR1/$tfile-2
1848 touch $DIR1/$tfile-3
1849 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1850 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1851 link $DIR1/$tfile-2 $DIR1/$tfile &
1854 mv $DIR2/$tfile $DIR2/$tfile-3 || error "rename must succeed"
1855 check_pdo_conflict $PID1 && { wait $PID1; error "rename isn't blocked"; }
1859 run_test 46f "pdirops: link and rename (src) =============="
1862 touch $DIR1/$tfile-2
1863 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1864 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1865 link $DIR1/$tfile-2 $DIR1/$tfile &
1868 stat $DIR2/$tfile > /dev/null || error "stat must succeed"
1869 check_pdo_conflict $PID1 && { wait $PID1; error "getattr isn't blocked"; }
1873 run_test 46g "pdirops: link vs getattr =============="
1876 touch $DIR1/$tfile-2
1877 #define OBD_FAIL_ONCE|OBD_FAIL_MDS_PDO_LOCK 0x145
1878 do_facet $SINGLEMDS lctl set_param fail_loc=0x80000145
1879 link $DIR1/$tfile-2 $DIR1/$tfile &
1882 ls -lia $DIR2/ > /dev/null
1883 check_pdo_conflict $PID1 && { wait $PID1; error "readdir isn't blocked"; }
1887 run_test 46h "pdirops: link vs readdir =============="
1891 dd if=/dev/zero of=$DIR1/$tfile bs=1K count=10
1892 #define OBD_FAIL_OSC_CP_ENQ_RACE 0x410
1893 do_facet client "lctl set_param fail_loc=0x410"
1894 $TRUNCATE $DIR2/$tfile $trunc_size
1895 do_facet client "lctl set_param fail_loc=0x0"
1897 size=`stat -c %s $DIR2/$tfile`
1898 [ $size -eq $trunc_size ] || error "wrong size"
1900 run_test 50 "osc lvb attrs: enqueue vs. CP AST =============="
1903 [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.3.0) ]] ||
1904 { skip "Need MDS version at least 2.3.0"; return; }
1906 mkdir -p $DIR1/$tdir
1907 file1=$DIR1/$tdir/file
1908 file2=$DIR2/$tdir/file
1910 echo orig > $file2 || error "Could not create $file2"
1911 version=$($LFS data_version $file1)
1914 echo append >> $file2 || error "Could not append to $file2"
1915 version2=$($LFS data_version $file1)
1916 [ "$version" != "$version2" ] ||
1917 error "append did not change data version: $version"
1920 echo overwrite > $file2 || error "Could not overwrite $file2"
1921 version3=$($LFS data_version $file1)
1922 [ "$version2" != "$version3" ] ||
1923 error "overwrite did not change data version: $version2"
1925 # Truncate before EOF
1926 $TRUNCATE $file2 3 || error "Could not truncate $file2"
1927 version4=$($LFS data_version $file1)
1928 [ "$version3" != "$version4" ] ||
1929 error "truncate did not change data version: $version3"
1931 # Truncate after EOF
1932 $TRUNCATE $file2 123456 || error "Could not truncate $file2"
1933 version5=$($LFS data_version $file1)
1934 [ "$version4" != "$version5" ] ||
1935 error "truncate did not change data version: $version4"
1937 # Chmod do not change version
1938 chmod 400 $file2 || error "Could not chmod 400 $file2"
1939 version6=$($LFS data_version $file1)
1940 [ "$version5" == "$version6" ] ||
1941 error "chmod should not change data version: $version5 != $version6"
1943 # Chown do not change version
1944 chown $RUNAS_ID $file2 || error "Could not chown $RUNAS_ID $file2"
1945 version7=$($LFS data_version $file1)
1946 [ "$version5" == "$version7" ] ||
1947 error "chown should not change data version: $version5 != $version7"
1949 run_test 60 "Verify data_version behaviour"
1951 log "cleanup: ======================================================"
1953 [ "$(mount | grep $MOUNT2)" ] && umount $MOUNT2
1955 complete $(basename $0) $SECONDS
1956 check_and_cleanup_lustre