6 # bug number for skipped test: 3192 15528/3811 9977 15528/11549
7 ALWAYS_EXCEPT=" 14b 19 28 29 $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 && ALWAYS_EXCEPT="$ALWAYS_EXCEPT 11 14" || true
13 # Tests that fail on uml
14 [ "$UML" = "true" ] && EXCEPT="$EXCEPT 7"
16 # Join file feature is not supported currently.
17 # It will be ported soon.
21 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
24 CHECKSTAT=${CHECKSTAT:-"checkstat -v"}
25 CREATETEST=${CREATETEST:-createtest}
26 GETSTRIPE=${GETSTRIPE:-lfs getstripe}
27 SETSTRIPE=${SETSTRIPE:-lstripe}
28 MCREATE=${MCREATE:-mcreate}
29 OPENFILE=${OPENFILE:-openfile}
30 OPENUNLINK=${OPENUNLINK:-openunlink}
31 TOEXCL=${TOEXCL:-toexcl}
32 TRUNCATE=${TRUNCATE:-truncate}
33 export TMP=${TMP:-/tmp}
34 MOUNT_2=${MOUNT_2:-"yes"}
35 CHECK_GRANT=${CHECK_GRANT:-"yes"}
36 GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
40 export NAME=${NAME:-local}
42 LUSTRE=${LUSTRE:-`dirname $0`/..}
43 . $LUSTRE/tests/test-framework.sh
47 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
49 [ "$SLOW" = "no" ] && EXCEPT_SLOW="12 16"
51 SANITYLOG=${TESTSUITELOG:-$TMP/$(basename $0 .sh).log}
59 [ "$SANITYLOG" ] && rm -f $SANITYLOG || true
61 check_and_setup_lustre
64 LOVNAME=`lctl get_param -n llite.*.lov.common_name | tail -n 1`
65 OSTCOUNT=`lctl get_param -n lov.$LOVNAME.numobd`
68 rm -rf $DIR1/[df][0-9]* $DIR1/lnk
70 # $RUNAS_ID may get set incorrectly somewhere else
71 [ $UID -eq 0 -a $RUNAS_ID -eq 0 ] && error "\$RUNAS_ID set to 0, but \$UID is also 0!"
73 check_runas_id $RUNAS_ID $RUNAS
79 [ -f $DIR2/f1 ] || error
81 run_test 1a "check create on 2 mtpt's =========================="
85 $CHECKSTAT -t file -p 0777 $DIR1/f1 || error
88 run_test 1b "check attribute updates on 2 mtpt's ==============="
91 $CHECKSTAT -t file -p 0666 $DIR1/f1 || error
93 run_test 1c "check after remount attribute updates on 2 mtpt's ="
97 $CHECKSTAT -a $DIR1/f1 || error
99 run_test 1d "unlink on one mountpoint removes file on other ===="
105 $CHECKSTAT -t file -p 0777 $DIR1/f2a || error
107 run_test 2a "check cached attribute updates on 2 mtpt's ========"
113 $CHECKSTAT -t file -p 0777 $DIR2/f2b || error
115 run_test 2b "check cached attribute updates on 2 mtpt's ========"
117 # NEED TO SAVE ROOT DIR MODE
120 $CHECKSTAT -t dir -p 0777 $DIR2 || error
122 run_test 2c "check cached attribute updates on 2 mtpt's root ==="
126 $CHECKSTAT -t dir -p 0755 $DIR2 || error
128 run_test 2d "check cached attribute updates on 2 mtpt's root ==="
135 $RUNAS dd if=/dev/zero of=$DIR2/$tfile count=1 || error
137 run_test 2e "check chmod on root is propagated to others"
140 ( cd $DIR1 ; ln -s this/is/good lnk )
141 [ "this/is/good" = "`perl -e 'print readlink("'$DIR2/lnk'");'`" ] || \
144 run_test 3 "symlink on one mtpt, readlink on another ==========="
147 multifstat $DIR1/f4 $DIR2/f4
149 run_test 4 "fstat validation on multiple mount points =========="
153 truncate $DIR2/f5 100
154 $CHECKSTAT -t file -s 100 $DIR1/f5 || error
157 run_test 5 "create a file on one mount, truncate it on the other"
160 openunlink $DIR1/$tfile $DIR2/$tfile || \
161 error "openunlink $DIR1/$tfile $DIR2/$tfile"
163 run_test 6 "remove of open file on other node =================="
167 opendirunlink $DIR1/$dir $DIR2/$dir || \
168 error "opendirunlink $DIR1/$dir $DIR2/$dir"
170 run_test 7 "remove of open directory on other node ============="
173 opendevunlink $DIR1/$tfile $DIR2/$tfile || \
174 error "opendevunlink $DIR1/$tfile $DIR2/$tfile"
176 run_test 8 "remove of open special file on other node =========="
182 for C in a b c d e f g h i j k l; do
183 dir=`eval echo \\$DIR$MTPT`
184 echo -n $C >> $dir/f9
185 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
187 [ "`cat $DIR1/f9`" = "abcdefghijkl" ] || \
188 error "`od -a $DIR1/f9` != abcdefghijkl"
190 run_test 9 "append of file with sub-page size on multiple mounts"
197 for C in a b c d e f g h i j k l; do
198 dir=`eval echo \\$DIR$MTPT`
199 echo -n $C | dd of=$dir/f10 bs=1 seek=$OFFSET count=1
200 [ "$MTPT" -eq 1 ] && MTPT=2 || MTPT=1
201 OFFSET=`expr $OFFSET + 1`
203 [ "`cat $DIR1/f10`" = "abcdefghijkl" ] || \
204 error "`od -a $DIR1/f10` != abcdefghijkl"
206 run_test 10a "write of file with sub-page size on multiple mounts "
210 yes "R" | head -c 4000 >$TMP/f10b-seed
211 dd if=$TMP/f10b-seed of=$DIR1/f10b bs=3k count=1 || error "dd $DIR1"
213 truncate $DIR1/f10b 4096 || error "truncate 4096"
215 dd if=$DIR2/f10b of=$TMP/f10b-lustre bs=4k count=1 || error "dd $DIR2"
217 # create a test file locally to compare
218 dd if=$TMP/f10b-seed of=$TMP/f10b bs=3k count=1 || error "dd random"
219 truncate $TMP/f10b 4096 || error "truncate 4096"
220 cmp $TMP/f10b $TMP/f10b-lustre || error "file miscompare"
221 rm $TMP/f10b $TMP/f10b-lustre $TMP/f10b-seed
223 run_test 10b "write of file with sub-page size on multiple mounts "
227 multiop_bg_pause $DIR1/d11/f O_c || return 1
229 cp -p /bin/ls $DIR1/d11/f
233 wait $MULTIPID || error
234 [ $RC -eq 0 ] && error || true
236 run_test 11 "execution of file opened for write should return error ===="
239 DIR=$DIR DIR2=$DIR2 sh lockorder.sh
241 run_test 12 "test lock ordering (link, stat, unlink) ==========="
243 test_13() { # bug 2451 - directory coherency
245 mkdir $DIR1/d13 || error
246 cd $DIR1/d13 || error
248 ( touch $DIR1/d13/f13 ) # needs to be a separate shell
250 rm -f $DIR2/d13/f13 || error
251 ls 2>&1 | grep f13 && error "f13 shouldn't return an error (1)" || true
252 # need to run it twice
253 ( touch $DIR1/d13/f13 ) # needs to be a separate shell
255 rm -f $DIR2/d13/f13 || error
256 ls 2>&1 | grep f13 && error "f13 shouldn't return an error (2)" || true
258 run_test 13 "test directory page revocation ===================="
262 cp -p /bin/ls $DIR1/d14/ls
263 exec 100>> $DIR1/d14/ls
264 $DIR2/d14/ls && error || true
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 grant_error=`dmesg | grep "> available"`
326 [ -z "$grant_error" ] || error "$grant_error"
328 run_test 15 "test out-of-space with multiple writers ==========="
331 rm -f $MOUNT1/fsxfile
332 lfs setstripe $MOUNT1/fsxfile -c -1 # b=10919
333 fsx -c 50 -p 100 -N 2500 -l $((SIZE * 256)) -S 0 $MOUNT1/fsxfile $MOUNT2/fsxfile
335 run_test 16 "2500 iterations of dual-mount fsx ================="
337 test_17() { # bug 3513, 3667
338 [ ! -d /proc/fs/lustre/ost ] && skip "remote OST, skipping OST-only test" && return
340 cp /etc/termcap $DIR1/f17
341 cancel_lru_locks osc > /dev/null
342 #define OBD_FAIL_ONCE|OBD_FAIL_LDLM_CREATE_RESOURCE 0x30a
343 lctl set_param fail_loc=0x8000030a
344 ls -ls $DIR1/f17 | awk '{ print $1,$6 }' > $DIR1/f17-1 & \
345 ls -ls $DIR2/f17 | awk '{ print $1,$6 }' > $DIR2/f17-2
347 diff -u $DIR1/f17-1 $DIR2/f17-2 || error "files are different"
349 run_test 17 "resource creation/LVB creation race ==============="
352 ./mmap_sanity -d $MOUNT1 -m $MOUNT2
355 run_test 18 "mmap sanity check ================================="
357 test_19() { # bug3811
358 [ -d /proc/fs/lustre/obdfilter ] || return 0
360 MAX=`cat /proc/fs/lustre/obdfilter/*/readcache_max_filesize | head -n 1`
361 for O in /proc/fs/lustre/obdfilter/*OST*; do
362 echo 4096 > $O/readcache_max_filesize
364 dd if=/dev/urandom of=$TMP/f19b bs=512k count=32
365 SUM=`cksum $TMP/f19b | cut -d" " -f 1,2`
366 cp $TMP/f19b $DIR1/f19b
367 for i in `seq 1 20`; do
368 [ $((i % 5)) -eq 0 ] && log "test_18 loop $i"
369 cancel_lru_locks osc > /dev/null
370 cksum $DIR1/f19b | cut -d" " -f 1,2 > $TMP/sum1 & \
371 cksum $DIR2/f19b | cut -d" " -f 1,2 > $TMP/sum2
373 [ "`cat $TMP/sum1`" = "$SUM" ] || \
374 error "$DIR1/f19b `cat $TMP/sum1` != $SUM"
375 [ "`cat $TMP/sum2`" = "$SUM" ] || \
376 error "$DIR2/f19b `cat $TMP/sum2` != $SUM"
378 for O in /proc/fs/lustre/obdfilter/*OST*; do
379 echo $MAX > $O/readcache_max_filesize
383 run_test 19 "test concurrent uncached read races ==============="
388 CNT=$((`cat /proc/fs/lustre/llite/*/dump_page_cache | wc -l`))
389 multiop $DIR1/f20 Ow8190c
390 multiop $DIR2/f20 Oz8194w8190c
391 multiop $DIR1/f20 Oz0r8190c
393 CNTD=$((`cat /proc/fs/lustre/llite/*/dump_page_cache | wc -l` - $CNT))
395 error $CNTD" page left in cache after lock cancel" || true
397 run_test 20 "test extra readahead page left in cache ===="
404 test_21() { # Bug 5907
406 mount /etc $DIR1/d21 --bind || error "mount failed" # Poor man's mount.
408 rmdir -v $DIR1/d21 && error "Removed mounted directory"
409 rmdir -v $DIR2/d21 && echo "Removed mounted directory from another mountpoint, needs to be fixed"
410 test -d $DIR1/d21 || error "Mounted directory disappeared"
412 test -d $DIR2/d21 || test -d $DIR1/d21 && error "Removed dir still visible after umount"
415 run_test 21 " Try to remove mountpoint on another dir ===="
417 JOIN=${JOIN:-"lfs join"}
419 test_22() { # Bug 9926
421 dd if=/dev/urandom of=$DIR1/d21/128k bs=1024 count=128
422 cp -p $DIR1/d21/128k $DIR1/d21/f_head
423 for ((i=0;i<10;i++)); do
424 cp -p $DIR1/d21/128k $DIR1/d21/f_tail
425 $JOIN $DIR1/d21/f_head $DIR1/d21/f_tail || error "join error"
426 $CHECKSTAT -a $DIR1/d21/f_tail || error "tail file exist after join"
428 echo aaaaaaaaaaa >> $DIR1/d21/no_joined
430 mv $DIR2/d21/f_head $DIR2/
431 munlink $DIR2/f_head || error "unlink joined file error"
432 cat $DIR2/d21/no_joined || error "cat error"
433 rm -rf $DIR2/d21/no_joined || error "unlink normal file error"
435 run_test 22 " After joining in one dir, open/close unlink file in anther dir"
437 test_23() { # Bug 5972
438 echo "others should see updated atime while another read" > $DIR1/f23
440 # clear the lock(mode: LCK_PW) gotten from creating operation
446 multiop_bg_pause $DIR1/f23 or20_c || return 1
449 time2=`stat -c "%X" $DIR2/f23`
451 if (( $time2 <= $time1 )); then
453 error "atime doesn't update among nodes"
456 kill -USR1 $MULTIPID || return 1
457 rm -f $DIR1/f23 || error "rm -f $DIR1/f23 failed"
460 run_test 23 " others should see updated atime while another read===="
464 lfs df || error "lfs df failed"
465 lfs df -ih || error "lfs df -ih failed"
466 lfs df -h $DIR1 || error "lfs df -h $DIR1 failed"
467 lfs df -i $DIR2 || error "lfs df -i $DIR2 failed"
468 lfs df $DIR1/$tfile || error "lfs df $DIR1/$tfile failed"
469 lfs df -ih $DIR2/$tfile || error "lfs df -ih $DIR2/$tfile failed"
471 OSC=`lctl dl | awk '/-osc-|OSC.*MNT/ {print $4}' | head -n 1`
472 # OSC=`lctl dl | awk '/-osc-/ {print $4}' | head -n 1`
473 lctl --device %$OSC deactivate
474 lfs df -i || error "lfs df -i with deactivated OSC failed"
475 lctl --device %$OSC recover
476 lfs df || error "lfs df with reactivated OSC failed"
478 run_test 24 "lfs df [-ih] [path] test ========================="
481 [ `lctl get_param -n mdc.*-mdc-*.connect_flags | grep -c acl` -lt 2 ] && \
482 skip "must have acl, skipping" && return
485 touch $DIR1/$tdir/f1 || error "touch $DIR1/$tdir/f1"
486 chmod 0755 $DIR1/$tdir/f1 || error "chmod 0755 $DIR1/$tdir/f1"
488 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #1"
489 setfacl -m u:$RUNAS_ID:--- $DIR1/$tdir || error "setfacl $DIR2/$tdir #1"
490 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 && error "checkstat $DIR2/$tdir/f1 #2"
491 setfacl -m u:$RUNAS_ID:r-x $DIR1/$tdir || error "setfacl $DIR2/$tdir #2"
492 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #3"
493 setfacl -m u:$RUNAS_ID:--- $DIR1/$tdir || error "setfacl $DIR2/$tdir #3"
494 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 && error "checkstat $DIR2/$tdir/f1 #4"
495 setfacl -x u:$RUNAS_ID: $DIR1/$tdir || error "setfacl $DIR2/$tdir #4"
496 $RUNAS $CHECKSTAT $DIR2/$tdir/f1 || error "checkstat $DIR2/$tdir/f1 #5"
500 run_test 25 "change ACL on one mountpoint be seen on another ==="
503 utime $DIR1/f26a -s $DIR2/f26a || error
505 run_test 26a "allow mtime to get older"
510 echo "aaa" >> $DIR1/$tfile
512 chmod a+x $DIR2/$tfile
513 mt1=`stat -c %Y $DIR1/$tfile`
514 mt2=`stat -c %Y $DIR2/$tfile`
516 if [ x"$mt1" != x"$mt2" ]; then
517 error "not equal mtime, client1: "$mt1", client2: "$mt2"."
520 run_test 26b "sync mtime between ost and mds"
525 dd if=/dev/zero of=$DIR2/$tfile bs=$((4096+4))k conv=notrunc count=4 seek=3 &
530 dd if=/dev/zero of=$DIR1/$tfile bs=$((16384-1024))k conv=notrunc count=1 seek=4 &
535 dd if=/dev/zero of=$DIR1/$tfile bs=8k conv=notrunc count=1 seek=0
537 lctl set_param -n ldlm.dump_namespaces ""
538 wait $DD1_PID $DD2_PID
539 [ $? -ne 0 ] && lctl dk $TMP/debug || true
541 run_test 27 "align non-overlapping extent locks from request ==="
543 test_28() { # bug 9977
544 ECHO_UUID="ECHO_osc1_UUID"
545 tOST=`$LCTL dl | | awk '/-osc-|OSC.*MNT/ { print $4 }' | head -1`
547 lfs setstripe $DIR1/$tfile -s 1048576 -i 0 -c 2
548 tOBJID=`lfs getstripe $DIR1/$tfile |grep "^[[:space:]]\+1" |awk '{print $2}'`
549 dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2
553 attach echo_client ECHO_osc1 $ECHO_UUID
557 tECHOID=`$LCTL dl | grep $ECHO_UUID | awk '{print $1}'`
558 $LCTL --device $tECHOID destroy "${tOBJID}:0"
566 # reading of 1st stripe should pass
567 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error
568 # reading of 2nd stripe should fail (this stripe was destroyed)
569 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 && error
571 # now, recreating test file
572 dd if=/dev/zero of=$DIR1/$tfile bs=1024k count=2 || error
573 # reading of 1st stripe should pass
574 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 || error
575 # reading of 2nd stripe should pass
576 dd if=$DIR2/$tfile of=/dev/null bs=1024k count=1 skip=1 || error
578 run_test 28 "read/write/truncate file with lost stripes"
580 test_29() { # bug 10999
582 #define OBD_FAIL_LDLM_GLIMPSE 0x30f
583 lctl set_param fail_loc=0x8000030f
586 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1
589 #bug 11549 - permanently turn test off in b1_5
590 run_test 29 "lock put race between glimpse and enqueue ========="
592 test_30() { #bug #11110
594 cp -f /bin/bash $DIR1/$tdir/bash
595 /bin/sh -c 'sleep 1; rm -f $DIR2/$tdir/bash; cp /bin/bash $DIR2/$tdir' &
596 err=$($DIR1/$tdir/bash -c 'sleep 2; openfile -f O_RDONLY /proc/$$/exe >& /dev/null; echo $?')
598 [ $err -ne 116 ] && error_ignore 12900 "return code ($err) != -ESTALE" && return
602 run_test 30 "recreate file race ========="
605 mkdir -p $DIR1/$tdir || error "Creating dir $DIR1/$tdir"
606 writes=`LANG=C dd if=/dev/zero of=$DIR/$tdir/$tfile count=1 2>&1 |
607 awk 'BEGIN { FS="+" } /out/ {print $1}'`
608 #define OBD_FAIL_LDLM_CANCEL_BL_CB_RACE 0x314
609 lctl set_param fail_loc=0x314
610 reads=`LANG=C dd if=$DIR2/$tdir/$tfile of=/dev/null 2>&1 |
611 awk 'BEGIN { FS="+" } /in/ {print $1}'`
612 [ $reads -eq $writes ] || error "read" $reads "blocks, must be" $writes
614 run_test 31 "voluntary cancel / blocking ast race=============="
616 # enable/disable lockless truncate feature, depending on the arg 0/1
617 enable_lockless_truncate() {
618 lctl set_param -n llite.*.lockless_truncate $1
621 test_32a() { # bug 11270
622 local p="$TMP/sanityN-$TESTNAME.parameters"
623 save_lustre_params $HOSTNAME llite.*.lockless_truncate > $p
626 enable_lockless_truncate 1
627 dd if=/dev/zero of=$DIR1/$tfile count=10 bs=1M > /dev/null 2>&1
629 log "checking cached lockless truncate"
630 $TRUNCATE $DIR1/$tfile 8000000
631 $CHECKSTAT -s 8000000 $DIR2/$tfile || error "wrong file size"
632 [ $(calc_llite_stats lockless_truncate) -eq 0 ] ||
633 error "lockless truncate doesn't use cached locks"
635 log "checking not cached lockless truncate"
636 $TRUNCATE $DIR2/$tfile 5000000
637 $CHECKSTAT -s 5000000 $DIR1/$tfile || error "wrong file size"
638 [ $(calc_llite_stats lockless_truncate) -ne 0 ] ||
639 error "not cached trancate isn't lockless"
641 log "disabled lockless truncate"
642 enable_lockless_truncate 0
644 $TRUNCATE $DIR2/$tfile 3000000
645 $CHECKSTAT -s 3000000 $DIR1/$tfile || error "wrong file size"
646 [ $(calc_llite_stats lockless_truncate) -eq 0 ] ||
647 error "lockless truncate disabling failed"
649 # restore lockless_truncate default values
650 restore_lustre_params < $p
653 run_test 32a "lockless truncate"
655 test_32b() { # bug 11270
657 local p="$TMP/sanityN-$TESTNAME.parameters"
658 save_lustre_params $HOSTNAME "llite.*.contention_seconds" > $p
659 for node in $(osts_nodes); do
660 save_lustre_params $node "ldlm.namespaces.filter-*.max_nolock_bytes" >> $p
661 save_lustre_params $node "ldlm.namespaces.filter-*.contended_locks" >> $p
662 save_lustre_params $node "ldlm.namespaces.filter-*.contention_seconds" >> $p
665 # agressive lockless i/o settings
666 for node in $(osts_nodes); do
667 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'
669 lctl set_param -n llite.*.contention_seconds 60
670 for i in $(seq 5); do
671 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
672 dd if=/dev/zero of=$DIR2/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
674 [ $(calc_llite_stats lockless_write_bytes) -ne 0 ] || error "lockless i/o was not triggered"
675 # disable lockless i/o (it is disabled by default)
676 for node in $(osts_nodes); do
677 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'
679 # set contention_seconds to 0 at client too, otherwise Lustre still
680 # remembers lock contention
681 lctl set_param -n llite.*.contention_seconds 0
683 for i in $(seq 5); do
684 dd if=/dev/zero of=$DIR1/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
685 dd if=/dev/zero of=$DIR2/$tfile bs=4k count=1 conv=notrunc > /dev/null 2>&1
687 [ $(calc_llite_stats lockless_write_bytes) -eq 0 ] ||
688 error "lockless i/o works when disabled"
690 restore_lustre_params <$p
693 run_test 32b "lockless i/o"
695 log "cleanup: ======================================================"
697 check_and_cleanup_lustre
699 echo '=========================== finished ==============================='
700 [ -f "$SANITYLOG" ] && cat $SANITYLOG && grep -q FAIL $SANITYLOG && exit 1 || true