3 # FIXME - there is no reason to use all of these different
4 # return codes, espcially when most of them are mapped to something
5 # else anyway. The combination of test number and return code
6 # figure out what failed.
12 # bug number for skipped test:
13 ALWAYS_EXCEPT="$CONF_SANITY_EXCEPT"
14 # UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
16 if [ "$FAILURE_MODE" = "HARD" ]; then
17 CONFIG_EXCEPTIONS="24a " && \
18 echo "Except the tests: $CONFIG_EXCEPTIONS for FAILURE_MODE=$FAILURE_MODE, bug 23573" && \
19 ALWAYS_EXCEPT="$ALWAYS_EXCEPT $CONFIG_EXCEPTIONS"
23 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 5d 19b 21b 27a"
27 PATH=$PWD/$SRCDIR:$SRCDIR:$SRCDIR/../utils:$PATH
29 PTLDEBUG=${PTLDEBUG:--1}
31 LUSTRE=${LUSTRE:-`dirname $0`/..}
32 RLUSTRE=${RLUSTRE:-$LUSTRE}
33 export MULTIOP=${MULTIOP:-multiop}
35 . $LUSTRE/tests/test-framework.sh
38 # use small MDS + OST size to speed formatting time
39 # do not use too small MDSSIZE/OSTSIZE, which affect the default jouranl size
42 . ${CONFIG:=$LUSTRE/tests/cfg/$NAME.sh}
44 if ! combined_mgs_mds; then
45 # bug number for skipped test: 23954
46 ALWAYS_EXCEPT="$ALWAYS_EXCEPT 24b"
49 # STORED_MDSSIZE is used in test_18
50 if [ -n "$MDSSIZE" ]; then
51 STORED_MDSSIZE=$MDSSIZE
54 # pass "-E lazy_itable_init" to mke2fs to speed up the formatting time
55 if [[ "$LDISKFS_MKFS_OPTS" != *lazy_itable_init* ]]; then
56 LDISKFS_MKFS_OPTS=$(csa_add "$LDISKFS_MKFS_OPTS" -E lazy_itable_init)
62 require_dsh_mds || exit 0
63 require_dsh_ost || exit 0
65 [ "$SLOW" = "no" ] && EXCEPT_SLOW="30a 31 45"
80 # who knows if/where $TUNEFS is installed? Better reformat if it fails...
81 do_facet ${facet} "$TUNEFS --quiet --writeconf $dev" ||
82 { echo "tunefs failed, reformatting instead" && reformat_and_config && return 1; }
89 # if writeconf fails anywhere, we reformat everything
90 writeconf1 mds `mdsdevname 1` || return 0
91 writeconf1 ost1 `ostdevname 1` || return 0
92 writeconf1 ost2 `ostdevname 2` || return 0
96 # The MGS must be started before the OSTs for a new fs, so start
97 # and stop to generate the startup logs.
100 wait_osc_import_state mds ost FULL
105 reformat_and_config() {
107 if ! combined_mgs_mds ; then
115 start mgs $MGSDEV $MGS_MOUNT_OPTS
119 local facet=$SINGLEMDS
120 # we can not use MDSDEV1 here because SINGLEMDS could be set not to mds1 only
121 local num=$(echo $facet | tr -d "mds")
122 local dev=$(mdsdevname $num)
123 echo "start mds service on `facet_active_host $facet`"
124 start $facet ${dev} $MDS_MOUNT_OPTS $@ || return 94
128 if ! combined_mgs_mds ; then
135 echo "stop mds service on `facet_active_host $SINGLEMDS`"
136 # These tests all use non-failover stop
137 stop $SINGLEMDS -f || return 97
141 echo "stop mgs service on `facet_active_host mgs`"
142 # These tests all use non-failover stop
143 stop mgs -f || return 97
147 echo "start ost1 service on `facet_active_host ost1`"
148 start ost1 `ostdevname 1` $OST_MOUNT_OPTS $@ || return 95
152 echo "stop ost1 service on `facet_active_host ost1`"
153 # These tests all use non-failover stop
154 stop ost1 -f || return 98
158 echo "start ost2 service on `facet_active_host ost2`"
159 start ost2 `ostdevname 2` $OST_MOUNT_OPTS $@ || return 92
163 echo "stop ost2 service on `facet_active_host ost2`"
164 # These tests all use non-failover stop
165 stop ost2 -f || return 93
170 echo "mount $FSNAME on ${MOUNTPATH}....."
171 zconf_mount `hostname` $MOUNTPATH || return 96
175 local mountopt="-o remount,$1"
177 echo "remount '$1' lustre on ${MOUNTPATH}....."
178 zconf_mount `hostname` $MOUNTPATH "$mountopt" || return 96
183 echo "umount lustre on ${MOUNTPATH}....."
184 zconf_umount `hostname` $MOUNTPATH || return 97
187 manual_umount_client(){
190 echo "manual umount lustre on ${MOUNT}...."
191 do_facet client "umount -d ${FORCE} $MOUNT"
197 start_mds || error "MDT start failed"
198 start_ost || error "OST start failed"
199 mount_client $MOUNT || error "client start failed"
200 client_up || error "client_up failed"
204 if ! combined_mgs_mds ; then
213 unload_modules_conf () {
214 if combined_mgs_mds || ! local_mode; then
215 unload_modules || return 1
220 stop_ost || return 202
221 stop_mds || return 201
222 unload_modules_conf || return 203
226 umount_client $MOUNT || return 200
227 cleanup_nocli || return $?
231 do_facet client "cp /etc/passwd $DIR/a" || return 71
232 do_facet client "rm $DIR/a" || return 72
233 # make sure lustre is actually mounted (touch will block,
234 # but grep won't, so do it after)
235 do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
236 echo "setup single mount lustre success"
240 do_facet client "touch $DIR/a" || return 71
241 do_facet client "rm $DIR/a" || return 72
242 do_facet client "touch $DIR2/a" || return 73
243 do_facet client "rm $DIR2/a" || return 74
244 echo "setup double mount lustre success"
249 if [ "$ONLY" == "setup" ]; then
254 if [ "$ONLY" == "cleanup" ]; then
261 #create single point mountpoint
267 check_mount || return 41
270 run_test 0 "single mount setup"
273 start_mds || error "MDT start failed"
275 echo "start ost second time..."
276 start_ost && error "2nd OST start should fail"
277 mount_client $MOUNT || error "client start failed"
278 check_mount || return 42
281 run_test 1 "start up ost twice (should return errors)"
285 echo "start mds second time.."
286 start_mds && error "2nd MDT start should fail"
289 check_mount || return 43
292 run_test 2 "start up mds twice (should return err)"
296 #mount.lustre returns an error if already in mtab
297 mount_client $MOUNT && error "2nd client mount should fail"
298 check_mount || return 44
301 run_test 3 "mount client twice (should return err)"
305 touch $DIR/$tfile || return 85
309 # ok for ost to fail shutdown
310 if [ 202 -ne $eno ]; then
315 run_test 4 "force cleanup ost, then cleanup"
317 test_5a() { # was test_5
319 touch $DIR/$tfile || return 1
320 fuser -m -v $MOUNT && echo "$MOUNT is in use by user space process."
322 stop_mds -f || return 2
324 # cleanup may return an error from the failed
325 # disconnects; for now I'll consider this successful
326 # if all the modules have unloaded.
330 echo "killing umount"
331 kill -TERM $UMOUNT_PID
332 echo "waiting for umount to finish"
334 if grep " $MOUNT " /proc/mounts; then
335 echo "test 5: /proc/mounts after failed umount"
339 echo "killing umount"
340 kill -TERM $UMOUNT_PID
341 echo "waiting for umount to finish"
343 grep " $MOUNT " /proc/mounts && echo "test 5: /proc/mounts after second umount" && return 11
347 # stop_mds is a no-op here, and should not fail
348 cleanup_nocli || return $?
349 # df may have lingering entry
351 # mtab may have lingering entry
355 while [ "$WAIT" -ne "$MAX_WAIT" ]; do
357 grep -q $MOUNT" " /etc/mtab || break
358 echo "Waiting /etc/mtab updated ... "
359 WAIT=$(( WAIT + sleep))
361 [ "$WAIT" -eq "$MAX_WAIT" ] && error "/etc/mtab is not updated in $WAIT secs"
362 echo "/etc/mtab updated in $WAIT secs"
364 run_test 5a "force cleanup mds, then cleanup"
372 grep " $MOUNT " /etc/mtab && \
373 error false "unexpected entry in mtab before mount" && return 10
377 if ! combined_mgs_mds ; then
378 trap cleanup_5b EXIT ERR
383 [ -d $MOUNT ] || mkdir -p $MOUNT
384 mount_client $MOUNT && rc=1
385 grep " $MOUNT " /etc/mtab && \
386 error "$MOUNT entry in mtab after failed mount" && rc=11
388 # stop_mds is a no-op here, and should not fail
389 cleanup_nocli || rc=$?
390 if ! combined_mgs_mds ; then
395 run_test 5b "Try to start a client with no MGS (should return errs)"
398 grep " $MOUNT " /etc/mtab && \
399 error false "unexpected entry in mtab before mount" && return 10
404 [ -d $MOUNT ] || mkdir -p $MOUNT
405 local oldfs="${FSNAME}"
406 FSNAME="wrong.${FSNAME}"
407 mount_client $MOUNT || :
409 grep " $MOUNT " /etc/mtab && \
410 error "$MOUNT entry in mtab after failed mount" && rc=11
412 cleanup_nocli || rc=$?
415 run_test 5c "cleanup after failed mount (bug 2712) (should return errs)"
418 grep " $MOUNT " /etc/mtab && \
419 error false "unexpected entry in mtab before mount" && return 10
425 mount_client $MOUNT || rc=1
427 grep " $MOUNT " /etc/mtab && \
428 error "$MOUNT entry in mtab after unmount" && rc=11
431 run_test 5d "mount with ost down"
434 grep " $MOUNT " /etc/mtab && \
435 error false "unexpected entry in mtab before mount" && return 10
441 #define OBD_FAIL_PTLRPC_DELAY_SEND 0x506
442 do_facet client "lctl set_param fail_loc=0x80000506"
443 mount_client $MOUNT || echo "mount failed (not fatal)"
445 grep " $MOUNT " /etc/mtab && \
446 error "$MOUNT entry in mtab after unmount" && rc=11
449 run_test 5e "delayed connect, don't crash (bug 10268)"
452 if combined_mgs_mds ; then
453 skip "combined mgs and mds"
457 grep " $MOUNT " /etc/mtab && \
458 error false "unexpected entry in mtab before mount" && return 10
462 [ -d $MOUNT ] || mkdir -p $MOUNT
463 mount_client $MOUNT &
465 echo client_mount pid is $pid
469 if ! ps -f -p $pid >/dev/null; then
472 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
473 error "mount returns $rc, expected to hang"
482 # mount should succeed after start mds
485 [ $rc -eq 0 ] || error "mount returned $rc"
486 grep " $MOUNT " /etc/mtab && echo "test 5f: mtab after mount"
490 run_test 5f "mds down, cleanup after failed mount (bug 2712)"
495 mount_client ${MOUNT} || return 87
496 touch $DIR/a || return 86
499 run_test 6 "manual umount, then mount again"
504 cleanup_nocli || return $?
506 run_test 7 "manual umount, then cleanup"
511 check_mount2 || return 45
512 umount_client $MOUNT2
515 run_test 8 "double mount setup"
520 do_facet ost1 lctl set_param debug=\'inode trace\' || return 1
521 do_facet ost1 lctl set_param subsystem_debug=\'mds ost\' || return 1
523 CHECK_PTLDEBUG="`do_facet ost1 lctl get_param -n debug`"
524 if [ "$CHECK_PTLDEBUG" ] && { \
525 [ "$CHECK_PTLDEBUG" = "trace inode warning error emerg console" ] ||
526 [ "$CHECK_PTLDEBUG" = "trace inode" ]; }; then
527 echo "lnet.debug success"
529 echo "lnet.debug: want 'trace inode', have '$CHECK_PTLDEBUG'"
532 CHECK_SUBSYS="`do_facet ost1 lctl get_param -n subsystem_debug`"
533 if [ "$CHECK_SUBSYS" ] && [ "$CHECK_SUBSYS" = "mds ost" ]; then
534 echo "lnet.subsystem_debug success"
536 echo "lnet.subsystem_debug: want 'mds ost', have '$CHECK_SUBSYS'"
539 stop_ost || return $?
541 run_test 9 "test ptldebug and subsystem for mkfs"
549 do_facet $facet "test -b $dev" || rc=1
550 if [[ "$size" ]]; then
551 local in=$(do_facet $facet "dd if=$dev of=/dev/null bs=1k count=1 skip=$size 2>&1" |\
552 awk '($3 == "in") { print $1 }')
553 [[ $in = "1+0" ]] || rc=1
559 # Test 16 was to "verify that lustre will correct the mode of OBJECTS".
560 # But with new MDS stack we don't care about the mode of local objects
561 # anymore, so this test is removed. See bug 22944 for more details.
565 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
566 skip "Only applicable to ldiskfs-based MDTs"
571 check_mount || return 41
574 echo "Remove mds config log"
575 if ! combined_mgs_mds ; then
579 do_facet mgs "$DEBUGFS -w -R 'unlink CONFIGS/$FSNAME-MDT0000' $MGSDEV || return \$?" || return $?
581 if ! combined_mgs_mds ; then
586 start_mds && return 42
589 run_test 17 "Verify failed mds_postsetup won't fail assertion (2936) (should return errs)"
592 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
593 skip "Only applicable to ldiskfs-based MDTs"
597 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
602 # check if current MDSSIZE is large enough
603 [ $MDSSIZE -ge $MIN ] && OK=1 && myMDSSIZE=$MDSSIZE && \
604 log "use MDSSIZE=$MDSSIZE"
606 # check if the global config has a large enough MDSSIZE
607 [ -z "$OK" -a ! -z "$STORED_MDSSIZE" ] && [ $STORED_MDSSIZE -ge $MIN ] && \
608 OK=1 && myMDSSIZE=$STORED_MDSSIZE && \
609 log "use STORED_MDSSIZE=$STORED_MDSSIZE"
611 # check if the block device is large enough
612 [ -z "$OK" ] && $(is_blkdev $SINGLEMDS $MDSDEV $MIN) && OK=1 &&
613 myMDSSIZE=$MIN && log "use device $MDSDEV with MIN=$MIN"
615 # check if a loopback device has enough space for fs metadata (5%)
617 if [ -z "$OK" ]; then
618 local SPACE=$(do_facet $SINGLEMDS "[ -f $MDSDEV -o ! -e $MDSDEV ] && df -P \\\$(dirname $MDSDEV)" |
619 awk '($1 != "Filesystem") {print $4}')
620 ! [ -z "$SPACE" ] && [ $SPACE -gt $((MIN / 20)) ] && \
621 OK=1 && myMDSSIZE=$MIN && \
622 log "use file $MDSDEV with MIN=$MIN"
625 [ -z "$OK" ] && skip_env "$MDSDEV too small for ${MIN}kB MDS" && return
628 echo "mount mds with large journal..."
630 local OLD_MDSSIZE=$MDSSIZE
634 echo "mount lustre system..."
636 check_mount || return 41
638 echo "check journal size..."
639 local FOUNDSIZE=$(do_facet $SINGLEMDS "$DEBUGFS -c -R 'stat <8>' $MDSDEV" | awk '/Size: / { print $NF; exit;}')
640 if [ $FOUNDSIZE -gt $((32 * 1024 * 1024)) ]; then
641 log "Success: mkfs creates large journals. Size: $((FOUNDSIZE >> 20))M"
643 error "expected journal size > 32M, found $((FOUNDSIZE >> 20))M"
651 run_test 18 "check mkfs creates large journals"
654 start_mds || return 1
655 stop_mds -f || return 2
657 run_test 19a "start/stop MDS without OSTs"
660 start_ost || return 1
661 stop_ost -f || return 2
663 run_test 19b "start/stop OSTs without MDS"
666 # first format the ost/mdt
670 check_mount || return 43
672 remount_client ro $MOUNT || return 44
673 touch $DIR/$tfile && echo "$DIR/$tfile created incorrectly" && return 45
674 [ -e $DIR/$tfile ] && echo "$DIR/$tfile exists incorrectly" && return 46
675 remount_client rw $MOUNT || return 47
677 [ ! -f $DIR/$tfile ] && echo "$DIR/$tfile missing" && return 48
678 MCNT=`grep -c $MOUNT /etc/mtab`
679 [ "$MCNT" -ne 1 ] && echo "$MOUNT in /etc/mtab $MCNT times" && return 49
684 run_test 20 "remount ro,rw mounts work and doesn't break /etc/mtab"
689 wait_osc_import_state mds ost FULL
693 run_test 21a "start mds before ost, stop ost first"
698 wait_osc_import_state mds ost FULL
702 run_test 21b "start ost before mds, stop mds first"
708 wait_osc_import_state mds ost2 FULL
712 #writeconf to remove all ost2 traces for subsequent tests
715 run_test 21c "start mds between two osts, stop mds last"
718 if combined_mgs_mds ; then
719 skip "need separate mgs device" && return 0
729 wait_osc_import_state mds ost2 FULL
735 #writeconf to remove all ost2 traces for subsequent tests
739 run_test 21d "start mgs then ost and then mds"
744 echo Client mount with ost in logs, but none running
746 # wait until mds connected to ost and open client connection
747 wait_osc_import_state mds ost FULL
750 # check_mount will block trying to contact ost
751 mcreate $DIR/$tfile || return 40
752 rm -f $DIR/$tfile || return 42
756 echo Client mount with a running ost
759 # if gss enabled, wait full time to let connection from
760 # mds to ost be established, due to the mismatch between
761 # initial connect timeout and gss context negotiation timeout.
762 # This perhaps could be remove after AT landed.
763 echo "sleep $((TIMEOUT + TIMEOUT + TIMEOUT))s"
764 sleep $((TIMEOUT + TIMEOUT + TIMEOUT))
767 wait_osc_import_state mds ost FULL
768 wait_osc_import_state client ost FULL
769 check_mount || return 41
774 run_test 22 "start a client before osts (should return errs)"
776 test_23a() { # was test_23
780 # force down client so that recovering mds waits for reconnect
781 local running=$(grep -c $MOUNT /proc/mounts) || true
782 if [ $running -ne 0 ]; then
783 echo "Stopping client $MOUNT (opts: -f)"
787 # enter recovery on mds
789 # try to start a new client
790 mount_client $MOUNT &
792 MOUNT_PID=$(ps -ef | grep "t lustre" | grep -v grep | awk '{print $2}')
793 MOUNT_LUSTRE_PID=`ps -ef | grep mount.lustre | grep -v grep | awk '{print $2}'`
794 echo mount pid is ${MOUNT_PID}, mount.lustre pid is ${MOUNT_LUSTRE_PID}
796 ps --ppid $MOUNT_LUSTRE_PID
797 echo "waiting for mount to finish"
799 # "ctrl-c" sends SIGINT but it usually (in script) does not work on child process
800 # SIGTERM works but it does not spread to offspring processses
801 kill -s TERM $MOUNT_PID
802 kill -s TERM $MOUNT_LUSTRE_PID
803 # we can not wait $MOUNT_PID because it is not a child of this shell
809 while [ "$WAIT" -lt "$MAX_WAIT" ]; do
811 PID1=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_PID)
812 PID2=$(ps -ef | awk '{print $2}' | grep -w $MOUNT_LUSTRE_PID)
815 [ -z "$PID1" -a -z "$PID2" ] && break
816 echo "waiting for mount to finish ... "
817 WAIT=$(( WAIT + sleep))
819 if [ "$WAIT" -eq "$MAX_WAIT" ]; then
820 error "MOUNT_PID $MOUNT_PID and "\
821 "MOUNT_LUSTRE_PID $MOUNT_LUSTRE_PID still not killed in $WAIT secs"
827 run_test 23a "interrupt client during recovery mount delay"
832 test_23b() { # was test_23
835 # Simulate -EINTR during mount OBD_FAIL_LDLM_CLOSE_THREAD
836 lctl set_param fail_loc=0x80000313
840 run_test 23b "Simulate -EINTR during mount"
842 fs2mds_HOST=$mds_HOST
843 fs2ost_HOST=$ost_HOST
845 MDSDEV1_2=$fs2mds_DEV
846 OSTDEV1_2=$fs2ost_DEV
847 OSTDEV2_2=$fs3ost_DEV
851 echo "umount $MOUNT2 ..."
852 umount $MOUNT2 || true
853 echo "stopping fs2mds ..."
854 stop fs2mds -f || true
855 echo "stopping fs2ost ..."
856 stop fs2ost -f || true
860 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
862 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
863 is_blkdev $SINGLEMDS $MDSDEV && \
864 skip_env "mixed loopback and real device not working" && return
867 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
869 local fs2mdsdev=$(mdsdevname 1_2)
870 local fs2ostdev=$(ostdevname 1_2)
871 local fs2mdsvdev=$(mdsvdevname 1_2)
872 local fs2ostvdev=$(ostvdevname 1_2)
874 # test 8-char fsname as well
875 local FSNAME2=test1234
876 add fs2mds $(mkfs_opts mds1) --nomgs --mgsnode=$MGSNID \
877 --fsname=${FSNAME2} --reformat $fs2mdsdev $fs2mdsvdev || exit 10
879 add fs2ost $(mkfs_opts ost1) --fsname=${FSNAME2} --reformat \
880 $fs2ostdev $fs2ostvdev || exit 10
883 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
884 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
886 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
888 check_mount || return 2
889 # files written on 1 should not show up on 2
890 cp /etc/passwd $DIR/$tfile
892 [ -e $MOUNT2/$tfile ] && error "File bleed" && return 7
895 cp /etc/passwd $MOUNT2/b || return 3
896 rm $MOUNT2/b || return 4
897 # 2 is actually mounted
898 grep $MOUNT2' ' /proc/mounts > /dev/null || return 5
900 facet_failover fs2mds
901 facet_failover fs2ost
904 # the MDS must remain up until last MDT
906 MDS=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
907 [ -z "$MDS" ] && error "No MDT" && return 8
909 cleanup_nocli || return 6
911 run_test 24a "Multiple MDTs on a single node"
914 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
916 if [ -z "$fs2mds_DEV" ]; then
917 local dev=${SINGLEMDS}_dev
919 is_blkdev $SINGLEMDS $MDSDEV && \
920 skip_env "mixed loopback and real device not working" && return
923 local fs2mdsdev=$(mdsdevname 1_2)
924 local fs2mdsvdev=$(mdsvdevname 1_2)
926 add fs2mds $(mkfs_opts mds1) --mgs --fsname=${FSNAME}2 --reformat \
927 $fs2mdsdev $fs2mdsvdev || exit 10
929 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && return 2
932 run_test 24b "Multiple MGSs on a single node (should return err)"
936 check_mount || return 2
937 local MODULES=$($LCTL modules | awk '{ print $2 }')
938 rmmod $MODULES 2>/dev/null || true
941 run_test 25 "Verify modules are referenced"
945 # we need modules before mount for sysctl, so make sure...
946 do_facet $SINGLEMDS "lsmod | grep -q lustre || modprobe lustre"
947 #define OBD_FAIL_MDS_FS_SETUP 0x135
948 do_facet $SINGLEMDS "lctl set_param fail_loc=0x80000135"
949 start_mds && echo MDS started && return 1
950 lctl get_param -n devices
951 DEVS=$(lctl get_param -n devices | egrep -v MG | wc -l)
952 [ $DEVS -gt 0 ] && return 2
953 # start mds to drop writeconf setting
954 start_mds || return 3
956 unload_modules_conf || return $?
958 run_test 26 "MDT startup failure cleans LOV (should return errs)"
961 start_ost || return 1
962 start_mds || return 2
963 echo "Requeue thread should have started: "
964 ps -e | grep ll_cfg_requeue
965 set_conf_param_and_check ost1 \
966 "lctl get_param -n obdfilter.$FSNAME-OST0000.client_cache_seconds" \
967 "$FSNAME-OST0000.ost.client_cache_seconds" || return 3
970 run_test 27a "Reacquire MGS lock if OST started first"
975 local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }')
977 facet_failover $SINGLEMDS
978 set_conf_param_and_check $SINGLEMDS \
979 "lctl get_param -n mdt.$device.identity_acquire_expire" \
980 "$device.mdt.identity_acquire_expire" || return 3
981 set_conf_param_and_check client \
982 "lctl get_param -n mdc.$device-mdc-*.max_rpcs_in_flight"\
983 "$device.mdc.max_rpcs_in_flight" || return 4
987 run_test 27b "Reacquire MGS lock after failover"
991 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
992 PARAM="$FSNAME.llite.max_read_ahead_whole_mb"
995 set_conf_param_and_check client "$TEST" "$PARAM" $FINAL || return 3
996 FINAL=$(($FINAL + 1))
997 set_conf_param_and_check client "$TEST" "$PARAM" $FINAL || return 4
998 umount_client $MOUNT || return 200
1001 if [ $RESULT -ne $FINAL ]; then
1002 echo "New config not seen: wanted $FINAL got $RESULT"
1005 echo "New config success: got $RESULT"
1007 set_conf_param_and_check client "$TEST" "$PARAM" $ORIG || return 5
1010 run_test 28 "permanent parameter setting"
1013 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
1014 setup > /dev/null 2>&1
1018 local PARAM="$FSNAME-OST0001.osc.active"
1019 local PROC_ACT="osc.$FSNAME-OST0001-osc-[^M]*.active"
1020 local PROC_UUID="osc.$FSNAME-OST0001-osc-[^M]*.ost_server_uuid"
1022 ACTV=$(lctl get_param -n $PROC_ACT)
1024 set_conf_param_and_check client \
1025 "lctl get_param -n $PROC_ACT" "$PARAM" $DEAC || return 2
1026 # also check ost_server_uuid status
1027 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV)
1028 if [ -z "$RESULT" ]; then
1029 echo "Live client not deactivated: $(lctl get_param -n $PROC_UUID)"
1032 echo "Live client success: got $RESULT"
1036 local mdtosc=$(get_mdtosc_proc_path $SINGLEMDS $FSNAME-OST0001)
1037 mdtosc=${mdtosc/-MDT*/-MDT\*}
1038 local MPROC="osc.$mdtosc.active"
1043 RESULT=`do_facet $SINGLEMDS " lctl get_param -n $MPROC"`
1044 [ ${PIPESTATUS[0]} = 0 ] || error "Can't read $MPROC"
1045 if [ $RESULT -eq $DEAC ]; then
1046 echo "MDT deactivated also after $WAIT sec (got $RESULT)"
1050 if [ $WAIT -eq $MAX ]; then
1051 echo "MDT not deactivated: wanted $DEAC got $RESULT"
1054 echo "Waiting $(($MAX - $WAIT)) secs for MDT deactivated"
1057 # test new client starts deactivated
1058 umount_client $MOUNT || return 200
1060 RESULT=$(lctl get_param -n $PROC_UUID | grep DEACTIV | grep NEW)
1061 if [ -z "$RESULT" ]; then
1062 echo "New client not deactivated from start: $(lctl get_param -n $PROC_UUID)"
1065 echo "New client success: got $RESULT"
1068 # make sure it reactivates
1069 set_conf_param_and_check client \
1070 "lctl get_param -n $PROC_ACT" "$PARAM" $ACTV || return 6
1072 umount_client $MOUNT
1075 #writeconf to remove all ost2 traces for subsequent tests
1078 run_test 29 "permanently remove an OST"
1083 echo Big config llog
1084 TEST="lctl get_param -n llite.$FSNAME-*.max_read_ahead_whole_mb"
1086 LIST=(1 2 3 4 5 4 3 2 1 2 3 4 5 4 3 2 1 2 3 4 5)
1087 for i in ${LIST[@]}; do
1088 set_conf_param_and_check client "$TEST" \
1089 "$FSNAME.llite.max_read_ahead_whole_mb" $i || return 3
1091 # make sure client restart still works
1092 umount_client $MOUNT
1093 mount_client $MOUNT || return 4
1094 [ "$($TEST)" -ne "$i" ] && error "Param didn't stick across restart $($TEST) != $i"
1097 echo Erase parameter setting
1098 do_facet mgs "$LCTL conf_param -d $FSNAME.llite.max_read_ahead_whole_mb" || return 6
1099 umount_client $MOUNT
1100 mount_client $MOUNT || return 6
1102 echo "deleted (default) value=$FINAL, orig=$ORIG"
1103 # assumes this parameter started at the default value
1104 [ "$FINAL" -eq "$ORIG" ] || fail "Deleted value=$FINAL, orig=$ORIG"
1108 run_test 30a "Big config llog and conf_param deletion"
1113 # Make a fake nid. Use the OST nid, and add 20 to the least significant
1114 # numerical part of it. Hopefully that's not already a failover address for
1116 OSTNID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
1117 ORIGVAL=$(echo $OSTNID | egrep -oi "[0-9]*@")
1118 NEWVAL=$((($(echo $ORIGVAL | egrep -oi "[0-9]*") + 20) % 256))
1119 NEW=$(echo $OSTNID | sed "s/$ORIGVAL/$NEWVAL@/")
1120 echo "Using fake nid $NEW"
1122 TEST="$LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids | sed -n 's/.*\($NEW\).*/\1/p'"
1123 set_conf_param_and_check client "$TEST" \
1124 "$FSNAME-OST0000.failover.node" $NEW ||
1125 error "didn't add failover nid $NEW"
1126 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1128 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1129 echo "should have 2 failover nids: $NIDCOUNT"
1130 [ $NIDCOUNT -eq 2 ] || error "Failover nid not added"
1131 do_facet mgs "$LCTL conf_param -d $FSNAME-OST0000.failover.node" || error "conf_param delete failed"
1132 umount_client $MOUNT
1133 mount_client $MOUNT || return 3
1135 NIDS=$($LCTL get_param -n osc.$FSNAME-OST0000-osc-[^M]*.import | grep failover_nids)
1137 NIDCOUNT=$(($(echo "$NIDS" | wc -w) - 1))
1138 echo "only 1 final nid should remain: $NIDCOUNT"
1139 [ $NIDCOUNT -eq 1 ] || error "Failover nids not removed"
1143 run_test 30b "Remove failover nids"
1145 test_31() { # bug 10734
1146 # ipaddr must not exist
1147 mount -t lustre 4.3.2.1@tcp:/lustre $MOUNT || true
1150 run_test 31 "Connect to non-existent node (shouldn't crash)"
1152 # Use these start32/stop32 fn instead of t-f start/stop fn,
1153 # for local devices, to skip global facet vars init
1157 echo "Stopping local ${MOUNT%/*}/${facet} (opts:$@)"
1158 umount -d $@ ${MOUNT%/*}/${facet}
1167 mkdir -p ${MOUNT%/*}/${facet}
1169 echo "Starting local ${facet}: $@ $device ${MOUNT%/*}/${facet}"
1170 mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}
1172 if [ $RC -ne 0 ]; then
1173 echo "mount -t lustre $@ ${device} ${MOUNT%/*}/${facet}"
1174 echo "Start of ${device} of local ${facet} failed ${RC}"
1180 cleanup_nocli32 () {
1188 echo "Cleanup test_32 umount $MOUNT ..."
1189 umount -f $MOUNT || true
1190 echo "Cleanup local mds ost1 ..."
1192 combined_mgs_mds || start_mgs
1197 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
1198 skip "Only applicable to ldiskfs-based MDTs"
1202 client_only && skip "client only testing" && return 0
1203 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1204 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return 0
1206 local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
1207 [ ! -r $DISK1_8 ] && skip_env "Cannot find $DISK1_8" && return 0
1208 local tmpdir=$TMP/conf32a
1210 tar xjvf $DISK1_8 -C $tmpdir || \
1211 { skip_env "Cannot untar $DISK1_8" && return 0; }
1214 $LCTL set_param debug="$PTLDEBUG"
1216 $TUNEFS $tmpdir/mds || error "tunefs failed"
1218 combined_mgs_mds || stop mgs
1220 # nids are wrong, so client wont work, but server should start
1221 start32 mds1 $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1222 trap cleanup_32 EXIT INT || return 3
1224 local UUID=$($LCTL get_param -n mdt.lustre-MDT0000.uuid)
1226 [ "$UUID" == "lustre-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1228 $TUNEFS --mgsnode=$HOSTNAME $tmpdir/ost1 || error "tunefs failed"
1229 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1230 UUID=$($LCTL get_param -n obdfilter.lustre-OST0000.uuid)
1232 [ "$UUID" == "lustre-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1234 local NID=$($LCTL list_nids | head -1)
1236 echo "OSC changes should succeed:"
1237 $LCTL conf_param lustre-OST0000.osc.max_dirty_mb=15 || return 7
1238 $LCTL conf_param lustre-OST0000.failover.node=$NID || return 8
1241 echo "MDC changes should succeed:"
1242 $LCTL conf_param lustre-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1243 $LCTL conf_param lustre-MDT0000.failover.node=$NID || return 10
1246 echo "LOV changes should succeed:"
1247 $LCTL pool_new lustre.interop || return 11
1248 $LCTL conf_param lustre-MDT0000.lov.stripesize=4M || return 12
1253 # mount a second time to make sure we didnt leave upgrade flag on
1255 $TUNEFS --dryrun $tmpdir/mds || error "tunefs failed"
1257 combined_mgs_mds || stop mgs
1259 start32 mds1 $tmpdir/mds "-o loop,exclude=lustre-OST0000" && \
1260 trap cleanup_32 EXIT INT || return 12
1264 rm -rf $tmpdir || true # true is only for TMP on NFS
1266 run_test 32a "Upgrade from 1.8 (not live)"
1269 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
1270 skip "Only applicable to ldiskfs-based MDTs"
1274 client_only && skip "client only testing" && return 0
1275 [ "$NETTYPE" = "tcp" ] || { skip "NETTYPE != tcp" && return 0; }
1276 [ -z "$TUNEFS" ] && skip_env "No tunefs" && return
1278 local DISK1_8=$LUSTRE/tests/disk1_8.tar.bz2
1279 [ ! -r $DISK1_8 ] && skip_env "Cannot find $DISK1_8" && return 0
1280 local tmpdir=$TMP/conf32b
1282 tar xjvf $DISK1_8 -C $tmpdir || \
1283 { skip_env "Cannot untar $DISK1_8" && return ; }
1286 $LCTL set_param debug="+config"
1287 local NEWNAME=lustre
1289 # writeconf will cause servers to register with their current nids
1290 $TUNEFS --writeconf --erase-params \
1291 --param mdt.identity_upcall=$L_GETIDENTITY \
1292 --fsname=$NEWNAME $tmpdir/mds || error "tunefs failed"
1293 combined_mgs_mds || stop mgs
1295 start32 mds1 $tmpdir/mds "-o loop" && \
1296 trap cleanup_32 EXIT INT || return 3
1298 local UUID=$($LCTL get_param -n mdt.${NEWNAME}-MDT0000.uuid)
1300 [ "$UUID" == "${NEWNAME}-MDT0000_UUID" ] || error "UUID is wrong: $UUID"
1302 $TUNEFS --writeconf --erase-params \
1303 --mgsnode=$HOSTNAME --fsname=$NEWNAME $tmpdir/ost1 ||\
1304 error "tunefs failed"
1305 start32 ost1 $tmpdir/ost1 "-o loop" || return 5
1306 UUID=$($LCTL get_param -n obdfilter.${NEWNAME}-OST0000.uuid)
1308 [ "$UUID" == "${NEWNAME}-OST0000_UUID" ] || error "UUID is wrong: $UUID"
1310 local NID=$($LCTL list_nids | head -1)
1312 echo "OSC changes should succeed:"
1313 $LCTL conf_param ${NEWNAME}-OST0000.osc.max_dirty_mb=15 || return 7
1314 $LCTL conf_param ${NEWNAME}-OST0000.failover.node=$NID || return 8
1317 echo "MDC changes should succeed:"
1318 $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=9 || return 9
1319 $LCTL conf_param ${NEWNAME}-MDT0000.failover.node=$NID || return 10
1322 echo "LOV changes should succeed:"
1323 $LCTL pool_new ${NEWNAME}.interop || return 11
1324 $LCTL conf_param ${NEWNAME}-MDT0000.lov.stripesize=4M || return 12
1327 # MDT and OST should have registered with new nids, so we should have
1328 # a fully-functioning client
1329 echo "Check client and old fs contents"
1331 local device=`h2$NETTYPE $HOSTNAME`:/$NEWNAME
1332 echo "Starting local client: $HOSTNAME: $device $MOUNT"
1333 mount -t lustre $device $MOUNT || return 1
1335 local old=$($LCTL get_param -n mdc.*.max_rpcs_in_flight)
1336 local new=$((old + 5))
1337 $LCTL conf_param ${NEWNAME}-MDT0000.mdc.max_rpcs_in_flight=$new
1338 wait_update $HOSTNAME "$LCTL get_param -n mdc.*.max_rpcs_in_flight" $new || return 11
1340 [ "$(cksum $MOUNT/passwd | cut -d' ' -f 1,2)" == "94306271 1478" ] || return 12
1345 rm -rf $tmpdir || true # true is only for TMP on NFS
1347 run_test 32b "Upgrade from 1.8 with writeconf"
1349 test_33a() { # bug 12333, was test_33
1351 local FSNAME2=test-123
1352 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
1355 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST
1357 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" ]; then
1358 local dev=${SINGLEMDS}_dev
1359 local MDSDEV=${!dev}
1360 is_blkdev $SINGLEMDS $MDSDEV && \
1361 skip_env "mixed loopback and real device not working" && return
1364 local fs2mdsdev=$(mdsdevname 1_2)
1365 local fs2ostdev=$(ostdevname 1_2)
1366 local fs2mdsvdev=$(mdsvdevname 1_2)
1367 local fs2ostvdev=$(ostvdevname 1_2)
1369 if [ $(facet_fstype mds1) == ldiskfs ]; then
1370 mkfsoptions="--mkfsoptions=\\\"-J size=8\\\"" # See bug 17931.
1373 add fs2mds $(mkfs_opts mds1) --fsname=${FSNAME2} --reformat \
1374 $mkfsoptions $fs2mdsdev $fs2mdsvdev || exit 10
1375 add fs2ost $(mkfs_opts ost1) --mgsnode=$MGSNID --fsname=${FSNAME2} \
1376 --index=8191 --reformat $fs2ostdev $fs2ostvdev || exit 10
1378 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS && trap cleanup_24a EXIT INT
1379 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1380 do_facet $SINGLEMDS "$LCTL conf_param $FSNAME2.sys.timeout=200" || rc=1
1382 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || rc=2
1385 cp /etc/hosts $MOUNT2/ || rc=3
1386 $LFS getstripe $MOUNT2/hosts
1391 cleanup_nocli || rc=6
1394 run_test 33a "Mount ost with a large index number"
1396 test_33b() { # was test_34
1399 do_facet client dd if=/dev/zero of=$MOUNT/24 bs=1024k count=1
1400 # Drop lock cancelation reply during umount
1401 #define OBD_FAIL_LDLM_CANCEL 0x304
1402 do_facet client lctl set_param fail_loc=0x80000304
1403 #lctl set_param debug=-1
1404 umount_client $MOUNT
1407 run_test 33b "Drop cancel during umount"
1411 do_facet client "sh runmultiop_bg_pause $DIR/file O_c"
1412 manual_umount_client
1414 do_facet client killall -USR1 multiop
1415 if [ $rc -eq 0 ]; then
1416 error "umount not fail!"
1421 run_test 34a "umount with opened file should be fail"
1426 touch $DIR/$tfile || return 1
1427 stop_mds --force || return 2
1429 manual_umount_client --force
1431 if [ $rc -ne 0 ]; then
1432 error "mtab after failed umount - rc $rc"
1438 run_test 34b "force umount with failed mds should be normal"
1442 touch $DIR/$tfile || return 1
1443 stop_ost --force || return 2
1445 manual_umount_client --force
1447 if [ $rc -ne 0 ]; then
1448 error "mtab after failed umount - rc $rc"
1454 run_test 34c "force umount with failed ost should be normal"
1456 test_35a() { # bug 12459
1459 DBG_SAVE="`lctl get_param -n debug`"
1460 lctl set_param debug="ha"
1462 log "Set up a fake failnode for the MDS"
1464 local device=$(do_facet $SINGLEMDS "lctl get_param -n devices" | awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
1465 do_facet mgs $LCTL conf_param ${device}.failover.node=$FAKENID || return 4
1467 log "Wait for RECONNECT_INTERVAL seconds (10s)"
1470 MSG="conf-sanity.sh test_35a `date +%F%kh%Mm%Ss`"
1473 log "Stopping the MDT:"
1474 stop_mds || return 5
1476 df $MOUNT > /dev/null 2>&1 &
1478 log "Restarting the MDT:"
1479 start_mds || return 6
1480 log "Wait for df ($DFPID) ... "
1483 lctl set_param debug="$DBG_SAVE"
1485 # retrieve from the log the first server that the client tried to
1486 # contact after the connection loss
1487 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1488 NEXTCONN=`awk "/${MSG}/ {start = 1;}
1489 /import_select_connection.*$device-mdc.* using connection/ {
1491 if (\\\$NF ~ /$FAKENID/)
1497 }" $TMP/lustre-log-$TESTNAME.log`
1498 [ "$NEXTCONN" != "0" ] && log "The client didn't try to reconnect to the last active server (tried ${NEXTCONN} instead)" && return 7
1500 # remove nid settings
1503 run_test 35a "Reconnect to the last active server first"
1505 test_35b() { # bug 18674
1506 remote_mds || { skip "local MDS" && return 0; }
1510 $LCTL set_param debug="ha"
1512 MSG="conf-sanity.sh test_35b `date +%F%kh%Mm%Ss`"
1515 log "Set up a fake failnode for the MDS"
1517 local device=$(do_facet $SINGLEMDS "$LCTL get_param -n devices" | \
1518 awk '($3 ~ "mdt" && $4 ~ "MDT") { print $4 }' | head -1)
1519 do_facet mgs "$LCTL conf_param ${device}.failover.node=$FAKENID" || \
1522 local at_max_saved=0
1523 # adaptive timeouts may prevent seeing the issue
1524 if at_is_enabled; then
1525 at_max_saved=$(at_max_get mds)
1526 at_max_set 0 mds client
1529 mkdir -p $MOUNT/$tdir
1531 log "Injecting EBUSY on MDS"
1532 # Setting OBD_FAIL_MDS_RESEND=0x136
1533 do_facet $SINGLEMDS "$LCTL set_param fail_loc=0x80000136" || return 2
1535 $LCTL set_param mdc.${FSNAME}*.stats=clear
1537 log "Creating a test file and stat it"
1538 touch $MOUNT/$tdir/$tfile
1539 stat $MOUNT/$tdir/$tfile
1541 log "Stop injecting EBUSY on MDS"
1542 do_facet $SINGLEMDS "$LCTL set_param fail_loc=0" || return 3
1543 rm -f $MOUNT/$tdir/$tfile
1546 # restore adaptive timeout
1547 [ $at_max_saved -ne 0 ] && at_max_set $at_max_saved mds client
1549 $LCTL dk $TMP/lustre-log-$TESTNAME.log
1551 CONNCNT=`$LCTL get_param mdc.${FSNAME}*.stats | awk '/mds_connect/{print $2}'`
1553 # retrieve from the log if the client has ever tried to
1554 # contact the fake server after the loss of connection
1555 FAILCONN=`awk "BEGIN {ret = 0;}
1556 /import_select_connection.*${FSNAME}-MDT0000-mdc.* using connection/ {
1558 if (\\\$NF ~ /$FAKENID/) {
1563 END {print ret}" $TMP/lustre-log-$TESTNAME.log`
1565 [ "$FAILCONN" == "0" ] && \
1566 log "ERROR: The client reconnection has not been triggered" && \
1568 [ "$FAILCONN" == "2" ] && \
1569 log "ERROR: The client tried to reconnect to the failover server while the primary was busy" && \
1573 # When OBD_FAIL_MDS_RESEND is hit, we sleep for 2 * obd_timeout
1574 # Reconnects are supposed to be rate limited to one every 5s
1575 [ $CONNCNT -gt $((2 * $TIMEOUT / 5 + 1)) ] && \
1576 log "ERROR: Too many reconnects $CONNCNT" && \
1580 # remove nid settings
1583 run_test 35b "Continue reconnection retries, if the active server is busy"
1586 [ $OSTCOUNT -lt 2 ] && skip_env "skipping test for single OST" && return
1588 [ "$ost_HOST" = "`hostname`" -o "$ost1_HOST" = "`hostname`" ] || \
1589 { skip "remote OST" && return 0; }
1592 local FSNAME2=test1234
1593 local fs3ost_HOST=$ost_HOST
1594 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
1596 [ -n "$ost1_HOST" ] && fs2ost_HOST=$ost1_HOST && fs3ost_HOST=$ost1_HOST
1598 if [ -z "$fs2ost_DEV" -o -z "$fs2mds_DEV" -o -z "$fs3ost_DEV" ]; then
1599 is_blkdev $SINGLEMDS $MDSDEV && \
1600 skip_env "mixed loopback and real device not working" && return
1603 local fs2mdsdev=$(mdsdevname 1_2)
1604 local fs2ostdev=$(ostdevname 1_2)
1605 local fs3ostdev=$(ostdevname 2_2)
1606 local fs2mdsvdev=$(mdsvdevname 1_2)
1607 local fs2ostvdev=$(ostvdevname 1_2)
1608 local fs3ostvdev=$(ostvdevname 2_2)
1610 add fs2mds $(mkfs_opts mds1) --fsname=${FSNAME2} --reformat \
1611 $fs2mdsdev $fs2mdsvdev || exit 10
1612 # XXX after we support non 4K disk blocksize in ldiskfs, specify a
1613 # different one than the default value here.
1614 add fs2ost $(mkfs_opts ost1) --mgsnode=$MGSNID --fsname=${FSNAME2} \
1615 --reformat $fs2ostdev $fs2ostvdev || exit 10
1616 add fs3ost $(mkfs_opts ost1) --mgsnode=$MGSNID --fsname=${FSNAME2} \
1617 --reformat $fs3ostdev $fs3ostvdev || exit 10
1619 start fs2mds $fs2mdsdev $MDS_MOUNT_OPTS
1620 start fs2ost $fs2ostdev $OST_MOUNT_OPTS
1621 start fs3ost $fs3ostdev $OST_MOUNT_OPTS
1623 mount -t lustre $MGSNID:/${FSNAME2} $MOUNT2 || return 1
1625 sleep 5 # until 11778 fixed
1627 dd if=/dev/zero of=$MOUNT2/$tfile bs=1M count=7 || return 2
1629 BKTOTAL=`lctl get_param -n obdfilter.*.kbytestotal | awk 'BEGIN{total=0}; {total+=$1}; END{print total}'`
1630 BKFREE=`lctl get_param -n obdfilter.*.kbytesfree | awk 'BEGIN{free=0}; {free+=$1}; END{print free}'`
1631 BKAVAIL=`lctl get_param -n obdfilter.*.kbytesavail | awk 'BEGIN{avail=0}; {avail+=$1}; END{print avail}'`
1632 STRING=`df -P $MOUNT2 | tail -n 1 | awk '{print $2","$3","$4}'`
1633 DFTOTAL=`echo $STRING | cut -d, -f1`
1634 DFUSED=`echo $STRING | cut -d, -f2`
1635 DFAVAIL=`echo $STRING | cut -d, -f3`
1636 DFFREE=$(($DFTOTAL - $DFUSED))
1638 ALLOWANCE=$((64 * $OSTCOUNT))
1640 if [ $DFTOTAL -lt $(($BKTOTAL - $ALLOWANCE)) ] ||
1641 [ $DFTOTAL -gt $(($BKTOTAL + $ALLOWANCE)) ] ; then
1642 echo "**** FAIL: df total($DFTOTAL) mismatch OST total($BKTOTAL)"
1645 if [ $DFFREE -lt $(($BKFREE - $ALLOWANCE)) ] ||
1646 [ $DFFREE -gt $(($BKFREE + $ALLOWANCE)) ] ; then
1647 echo "**** FAIL: df free($DFFREE) mismatch OST free($BKFREE)"
1650 if [ $DFAVAIL -lt $(($BKAVAIL - $ALLOWANCE)) ] ||
1651 [ $DFAVAIL -gt $(($BKAVAIL + $ALLOWANCE)) ] ; then
1652 echo "**** FAIL: df avail($DFAVAIL) mismatch OST avail($BKAVAIL)"
1657 stop fs3ost -f || return 200
1658 stop fs2ost -f || return 201
1659 stop fs2mds -f || return 202
1660 unload_modules_conf || return 203
1663 run_test 36 "df report consistency on OSTs with different block size"
1666 local mntpt=$(facet_mntpt $SINGLEMDS)
1667 local mdsdev=$(mdsdevname ${SINGLEMDS//mds/})
1668 local mdsdev_sym="$TMP/sym_mdt.img"
1669 local opts=$MDS_MOUNT_OPTS
1672 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
1673 skip "Currently only applicable to ldiskfs-based MDTs"
1677 echo "MDS : $mdsdev"
1678 echo "SYMLINK : $mdsdev_sym"
1679 do_facet $SINGLEMDS rm -f $mdsdev_sym
1681 do_facet $SINGLEMDS ln -s $mdsdev $mdsdev_sym
1683 echo "mount symlink device - $mdsdev_sym"
1685 if ! do_facet $SINGLEMDS test -b $mdsdev; then
1686 opts=$(csa_add "$opts" -o loop)
1688 mount_op=$(do_facet $SINGLEMDS mount -v -t lustre $opts \
1689 $mdsdev_sym $mntpt 2>&1)
1692 echo mount_op=$mount_op
1694 do_facet $SINGLEMDS "umount -d $mntpt && rm -f $mdsdev_sym"
1696 if $(echo $mount_op | grep -q "unable to set tunable"); then
1697 error "set tunables failed for symlink device"
1700 [ $rc -eq 0 ] || error "mount symlink $mdsdev_sym failed! rc=$rc"
1704 run_test 37 "verify set tunables works for symlink device"
1706 test_38() { # bug 14222
1707 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
1708 skip "Only applicable to ldiskfs-based MDTs"
1716 FILES=`find $SRC -type f -mtime +1 | head -n $COUNT`
1717 log "copying $(echo $FILES | wc -w) files to $DIR/$tdir"
1719 tar cf - $FILES | tar xf - -C $DIR/$tdir || \
1720 error "copying $SRC to $DIR/$tdir"
1722 umount_client $MOUNT
1724 log "rename lov_objid file on MDS"
1725 rm -f $TMP/lov_objid.orig
1727 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
1728 do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.orig\\\" $MDSDEV"
1729 do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1731 do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.orig"
1732 # check create in mds_lov_connect
1736 [ $V ] && log "verifying $DIR/$tdir/$f"
1737 diff -q $f $DIR/$tdir/$f || ERROR=y
1739 do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new\\\" $MDSDEV"
1740 do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.new"
1741 [ "$ERROR" = "y" ] && error "old and new files are different after connect" || true
1743 # check it's updates in sync
1744 umount_client $MOUNT
1747 do_facet $SINGLEMDS dd if=/dev/zero of=$TMP/lov_objid.clear bs=4096 count=1
1748 do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"rm lov_objid\\\" $MDSDEV"
1749 do_facet $SINGLEMDS "$DEBUGFS -w -R \\\"write $TMP/lov_objid.clear lov_objid\\\" $MDSDEV "
1754 [ $V ] && log "verifying $DIR/$tdir/$f"
1755 diff -q $f $DIR/$tdir/$f || ERROR=y
1757 do_facet $SINGLEMDS "$DEBUGFS -c -R \\\"dump lov_objid $TMP/lov_objid.new1\\\" $MDSDEV"
1758 do_facet $SINGLEMDS "od -Ax -td8 $TMP/lov_objid.new1"
1759 umount_client $MOUNT
1761 [ "$ERROR" = "y" ] && error "old and new files are different after sync" || true
1763 log "files compared the same"
1766 run_test 38 "MDS recreates missing lov_objid file from OST data"
1772 perl $SRCDIR/leak_finder.pl $TMP/debug 2>&1 | egrep '*** Leak:' &&
1773 error "memory leak detected" || true
1775 run_test 39 "leak_finder recognizes both LUSTRE and LNET malloc messages"
1777 test_40() { # bug 15759
1779 #define OBD_FAIL_TGT_TOOMANY_THREADS 0x706
1780 do_facet $SINGLEMDS "$LCTL set_param fail_loc=0x80000706"
1784 run_test 40 "race during service thread startup"
1786 test_41a() { #bug 14134
1787 if [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
1788 ! do_facet $SINGLEMDS test -b $(mdsdevname 1); then
1789 skip "Loop devices does not work with nosvc option"
1794 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
1796 start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1797 start ost1 `ostdevname 1` $OST_MOUNT_OPTS
1798 start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
1800 mount_client $MOUNT || return 1
1803 echo "blah blah" > $MOUNT/$tfile
1806 umount_client $MOUNT
1807 stop ost1 -f || return 201
1808 stop_mds -f || return 202
1809 stop_mds -f || return 203
1810 unload_modules_conf || return 204
1813 run_test 41a "mount mds with --nosvc and --nomgs"
1816 if [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
1817 ! do_facet $SINGLEMDS test -b $(mdsdevname 1); then
1818 skip "Loop devices does not work with nosvc option"
1822 ! combined_mgs_mds && skip "needs combined mgs device" && return 0
1826 local MDSDEV=$(mdsdevname ${SINGLEMDS//mds/})
1828 start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nosvc -n
1830 start $SINGLEMDS $MDSDEV $MDS_MOUNT_OPTS -o nomgs,force
1832 mount_client $MOUNT || return 1
1835 echo "blah blah" > $MOUNT/$tfile
1836 cat $MOUNT/$tfile || return 200
1838 umount_client $MOUNT
1839 stop_ost || return 201
1840 stop_mds -f || return 202
1841 stop_mds -f || return 203
1844 run_test 41b "mount mds with --nosvc and --nomgs on first mount"
1846 test_42() { #bug 14693
1848 check_mount || return 2
1849 do_facet mgs $LCTL conf_param lustre.llite.some_wrong_param=10
1850 umount_client $MOUNT
1851 mount_client $MOUNT || return 1
1855 run_test 42 "invalid config param should not prevent client from mounting"
1858 [ $UID -ne 0 -o $RUNAS_ID -eq 0 ] && skip_env "run as root"
1860 chmod ugo+x $DIR || error "chmod 0 failed"
1861 set_conf_param_and_check mds \
1862 "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
1863 "$FSNAME.mdt.root_squash" \
1865 set_conf_param_and_check mds \
1866 "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
1867 "$FSNAME.mdt.nosquash_nids" \
1871 # create set of test files
1873 echo "111" > $DIR/$tfile-userfile || error "write 1 failed"
1874 chmod go-rw $DIR/$tfile-userfile || error "chmod 1 failed"
1875 chown $RUNAS_ID.$RUNAS_ID $DIR/$tfile-userfile || error "chown failed"
1877 echo "222" > $DIR/$tfile-rootfile || error "write 2 failed"
1878 chmod go-rw $DIR/$tfile-rootfile || error "chmod 2 faield"
1880 mkdir $DIR/$tdir-rootdir -p || error "mkdir failed"
1881 chmod go-rwx $DIR/$tdir-rootdir || error "chmod 3 failed"
1882 touch $DIR/$tdir-rootdir/tfile-1 || error "touch failed"
1885 # check root_squash:
1886 # set root squash UID:GID to RUNAS_ID
1887 # root should be able to access only files owned by RUNAS_ID
1889 set_conf_param_and_check mds \
1890 "lctl get_param -n mdt.$FSNAME-MDT0000.root_squash" \
1891 "$FSNAME.mdt.root_squash" \
1892 "$RUNAS_ID:$RUNAS_ID"
1894 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-userfile)
1895 dd if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
1896 error "$ST: root read permission is denied"
1897 echo "$ST: root read permission is granted - ok"
1900 dd conv=notrunc if=$DIR/$tfile-userfile 1>/dev/null 2>/dev/null || \
1901 error "$ST: root write permission is denied"
1902 echo "$ST: root write permission is granted - ok"
1904 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
1905 dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null && \
1906 error "$ST: root read permission is granted"
1907 echo "$ST: root read permission is denied - ok"
1910 dd conv=notrunc of=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null && \
1911 error "$ST: root write permission is granted"
1912 echo "$ST: root write permission is denied - ok"
1914 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tdir-rootdir)
1915 rm $DIR/$tdir-rootdir/tfile-1 1>/dev/null 2>/dev/null && \
1916 error "$ST: root unlink permission is granted"
1917 echo "$ST: root unlink permission is denied - ok"
1919 touch $DIR/tdir-rootdir/tfile-2 1>/dev/null 2>/dev/null && \
1920 error "$ST: root create permission is granted"
1921 echo "$ST: root create permission is denied - ok"
1924 # check nosquash_nids:
1925 # put client's NID into nosquash_nids list,
1926 # root should be able to access root file after that
1928 local NIDLIST=$(lctl list_nids all | tr '\n' ' ')
1929 NIDLIST="2@elan $NIDLIST 192.168.0.[2,10]@tcp"
1930 NIDLIST=$(echo $NIDLIST | tr -s ' ' ' ')
1931 set_conf_param_and_check mds \
1932 "lctl get_param -n mdt.$FSNAME-MDT0000.nosquash_nids" \
1933 "$FSNAME-MDTall.mdt.nosquash_nids" \
1936 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tfile-rootfile)
1937 dd if=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
1938 error "$ST: root read permission is denied"
1939 echo "$ST: root read permission is granted - ok"
1942 dd conv=notrunc of=$DIR/$tfile-rootfile 1>/dev/null 2>/dev/null || \
1943 error "$ST: root write permission is denied"
1944 echo "$ST: root write permission is granted - ok"
1946 ST=$(stat -c "%n: owner uid %u (%A)" $DIR/$tdir-rootdir)
1947 rm $DIR/$tdir-rootdir/tfile-1 || \
1948 error "$ST: root unlink permission is denied"
1949 echo "$ST: root unlink permission is granted - ok"
1950 touch $DIR/$tdir-rootdir/tfile-2 || \
1951 error "$ST: root create permission is denied"
1952 echo "$ST: root create permission is granted - ok"
1956 run_test 43 "check root_squash and nosquash_nids"
1958 umount_client $MOUNT
1963 check_mount || return 2
1964 UUID=$($LCTL get_param llite.${FSNAME}*.uuid | cut -d= -f2)
1966 UUIDS=$(do_facet $SINGLEMDS "$LCTL get_param mdt.${FSNAME}*.exports.*.uuid")
1967 for VAL in $UUIDS; do
1968 NID=$(echo $VAL | cut -d= -f1)
1969 CLUUID=$(echo $VAL | cut -d= -f2)
1970 [ "$UUID" = "$CLUUID" ] && STATS_FOUND=yes && break
1972 [ "$STATS_FOUND" = "no" ] && error "stats not found for client"
1976 run_test 44 "mounted client proc entry exists"
1980 check_mount || return 2
1985 #define OBD_FAIL_PTLRPC_LONG_UNLINK 0x50f
1986 do_facet client "lctl set_param fail_loc=0x50f"
1989 manual_umount_client --force || return 3
1990 do_facet client "lctl set_param fail_loc=0x0"
1992 mount_client $MOUNT || return 4
1996 run_test 45 "long unlink handling in ptlrpcd"
2003 umount_client $MOUNT2 || rc=$?
2004 umount_client $MOUNT || rc=$?
2005 while [ $count -gt 0 ]; do
2006 stop ost${count} -f || rc=$?
2010 cleanup_nocli || rc=$?
2011 #writeconf to remove all ost2 traces for subsequent tests
2017 echo "Testing with $OSTCOUNT OSTs"
2019 start_mds || return 1
2020 #first client should see only one ost
2021 start_ost || return 2
2022 wait_osc_import_state mds ost FULL
2024 mount_client $MOUNT || return 3
2025 trap "cleanup_46a $OSTCOUNT" EXIT ERR
2028 for (( i=2; i<=$OSTCOUNT; i++ )); do
2029 start ost$i `ostdevname $i` $OST_MOUNT_OPTS || return $((i+2))
2032 # wait until osts in sync
2033 for (( i=2; i<=$OSTCOUNT; i++ )); do
2034 wait_osc_import_state mds ost$i FULL
2035 wait_osc_import_state client ost$i FULL
2038 #second client see all ost's
2040 mount_client $MOUNT2 || return 8
2041 $LFS setstripe -c -1 $MOUNT2 || return 9
2042 $LFS getstripe $MOUNT2 || return 10
2044 echo "ok" > $MOUNT2/widestripe
2045 $LFS getstripe $MOUNT2/widestripe || return 11
2046 # fill acl buffer for avoid expand lsm to them
2047 awk -F : '{if (FNR < 25) { print "u:"$1":rwx" }}' /etc/passwd | while read acl; do
2048 setfacl -m $acl $MOUNT2/widestripe
2052 stat $MOUNT/widestripe || return 12
2054 cleanup_46a $OSTCOUNT || { echo "cleanup_46a failed!" && return 13; }
2057 run_test 46a "handle ost additional - wide striped file"
2062 check_mount || return 2
2063 $LCTL set_param ldlm.namespaces.$FSNAME-*-*-*.lru_size=100
2067 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
2068 if echo $ns | grep "MDT[[:digit:]]*"; then
2071 lrs=$(echo $ns | sed 's/.*lru_size=//')
2072 lru_size[count]=$lrs
2077 facet_failover $SINGLEMDS
2078 client_up || return 3
2081 for ns in $($LCTL get_param ldlm.namespaces.$FSNAME-*-*-*.lru_size); do
2082 if echo $ns | grep "MDT[[:digit:]]*"; then
2085 lrs=$(echo $ns | sed 's/.*lru_size=//')
2086 if ! test "$lrs" -eq "${lru_size[count]}"; then
2087 n=$(echo $ns | sed -e 's/ldlm.namespaces.//' -e 's/.lru_size=.*//')
2088 error "$n has lost lru_size: $lrs vs. ${lru_size[count]}"
2096 run_test 47 "server restart does not make client loss lru_resize settings"
2101 # reformat after this test is needed - if test will failed
2102 # we will have unkillable file at FS
2106 test_48() { # bug 17636
2109 check_mount || return 2
2111 $LFS setstripe -c -1 $MOUNT || return 9
2112 $LFS getstripe $MOUNT || return 10
2114 echo "ok" > $MOUNT/widestripe
2115 $LFS getstripe $MOUNT/widestripe || return 11
2117 trap cleanup_48 EXIT ERR
2119 # fill acl buffer for avoid expand lsm to them
2120 getent passwd | awk -F : '{ print "u:"$1":rwx" }' | while read acl; do
2121 setfacl -m $acl $MOUNT/widestripe
2124 stat $MOUNT/widestripe || return 12
2129 run_test 48 "too many acls on file"
2131 # check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE
2132 test_49() { # bug 17710
2133 local timeout_orig=$TIMEOUT
2134 local ldlm_timeout_orig=$LDLM_TIMEOUT
2135 local LOCAL_TIMEOUT=20
2137 LDLM_TIMEOUT=$LOCAL_TIMEOUT
2138 TIMEOUT=$LOCAL_TIMEOUT
2142 check_mount || return 1
2144 echo "check ldlm_timout..."
2145 LDLM_MDS="`do_facet $SINGLEMDS lctl get_param -n ldlm_timeout`"
2146 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
2147 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
2149 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
2150 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
2153 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT / 3)) ]; then
2154 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2157 umount_client $MOUNT
2158 stop_ost || return 2
2159 stop_mds || return 3
2161 LDLM_TIMEOUT=$((LOCAL_TIMEOUT - 1))
2165 check_mount || return 7
2167 LDLM_MDS="`do_facet $SINGLEMDS lctl get_param -n ldlm_timeout`"
2168 LDLM_OST1="`do_facet ost1 lctl get_param -n ldlm_timeout`"
2169 LDLM_CLIENT="`do_facet client lctl get_param -n ldlm_timeout`"
2171 if [ $LDLM_MDS -ne $LDLM_OST1 ] || [ $LDLM_MDS -ne $LDLM_CLIENT ]; then
2172 error "Different LDLM_TIMEOUT:$LDLM_MDS $LDLM_OST1 $LDLM_CLIENT"
2175 if [ $LDLM_MDS -ne $((LOCAL_TIMEOUT - 1)) ]; then
2176 error "LDLM_TIMEOUT($LDLM_MDS) is not correct"
2179 cleanup || return $?
2181 LDLM_TIMEOUT=$ldlm_timeout_orig
2182 TIMEOUT=$timeout_orig
2184 run_test 49 "check PARAM_SYS_LDLM_TIMEOUT option of MKFS.LUSTRE"
2187 # Test both statfs and lfs df and fail if either one fails
2188 multiop_bg_pause $1 f_
2191 killall -USR1 multiop
2192 [ $RC1 -ne 0 ] && log "lazystatfs multiop failed"
2193 wait $PID || { RC1=$?; log "multiop return error "; }
2200 if [ $RC2 -eq 0 ]; then
2202 log "lazystatfs df failed"
2206 [[ $RC1 -ne 0 || $RC2 -eq 0 ]] && RC=1
2212 lctl set_param llite.$FSNAME-*.lazystatfs=1
2215 lazystatfs $MOUNT || error "lazystatfs failed but no down servers"
2217 cleanup || return $?
2219 run_test 50a "lazystatfs all servers available =========================="
2223 lctl set_param llite.$FSNAME-*.lazystatfs=1
2226 # Wait for client to detect down OST
2227 stop_ost || error "Unable to stop OST1"
2228 wait_osc_import_state mds ost DISCONN
2230 lazystatfs $MOUNT || error "lazystatfs should don't have returned EIO"
2232 umount_client $MOUNT || error "Unable to unmount client"
2233 stop_mds || error "Unable to stop MDS"
2235 run_test 50b "lazystatfs all servers down =========================="
2238 start_mds || error "Unable to start MDS"
2239 start_ost || error "Unable to start OST1"
2240 start_ost2 || error "Unable to start OST2"
2241 mount_client $MOUNT || error "Unable to mount client"
2242 lctl set_param llite.$FSNAME-*.lazystatfs=1
2245 # Wait for client to detect down OST
2246 stop_ost || error "Unable to stop OST1"
2247 wait_osc_import_state mds ost DISCONN
2248 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2250 umount_client $MOUNT || error "Unable to unmount client"
2251 stop_ost2 || error "Unable to stop OST2"
2252 stop_mds || error "Unable to stop MDS"
2253 #writeconf to remove all ost2 traces for subsequent tests
2256 run_test 50c "lazystatfs one server down =========================="
2259 start_mds || error "Unable to start MDS"
2260 start_ost || error "Unable to start OST1"
2261 start_ost2 || error "Unable to start OST2"
2262 mount_client $MOUNT || error "Unable to mount client"
2263 lctl set_param llite.$FSNAME-*.lazystatfs=1
2266 # Issue the statfs during the window where the client still
2267 # belives the OST to be available but it is in fact down.
2268 # No failure just a statfs which hangs for a timeout interval.
2269 stop_ost || error "Unable to stop OST1"
2270 lazystatfs $MOUNT || error "lazystatfs failed with one down server"
2272 umount_client $MOUNT || error "Unable to unmount client"
2273 stop_ost2 || error "Unable to stop OST2"
2274 stop_mds || error "Unable to stop MDS"
2275 #writeconf to remove all ost2 traces for subsequent tests
2278 run_test 50d "lazystatfs client/server conn race =========================="
2285 start_mds || return 1
2286 #first client should see only one ost
2287 start_ost || return 2
2288 wait_osc_import_state mds ost FULL
2290 # Wait for client to detect down OST
2291 stop_ost || error "Unable to stop OST1"
2292 wait_osc_import_state mds ost DISCONN
2294 mount_client $MOUNT || error "Unable to mount client"
2295 lctl set_param llite.$FSNAME-*.lazystatfs=0
2297 multiop_bg_pause $MOUNT _f
2301 if [ $RC1 -ne 0 ]; then
2302 log "multiop failed $RC1"
2305 sleep $(( $TIMEOUT+1 ))
2307 [ $? -ne 0 ] && error "process isn't sleep"
2308 start_ost || error "Unable to start OST1"
2309 wait $pid || error "statfs failed"
2312 umount_client $MOUNT || error "Unable to unmount client"
2313 stop_ost || error "Unable to stop OST1"
2314 stop_mds || error "Unable to stop MDS"
2316 run_test 50e "normal statfs all servers down =========================="
2321 CONN_PROC="osc.$FSNAME-OST0001-osc-[M]*.ost_server_uuid"
2323 start_mds || error "Unable to start mds"
2324 #first client should see only one ost
2325 start_ost || error "Unable to start OST1"
2326 wait_osc_import_state mds ost FULL
2328 start_ost2 || error "Unable to start OST2"
2329 wait_osc_import_state mds ost2 FULL
2331 # Wait for client to detect down OST
2332 stop_ost2 || error "Unable to stop OST2"
2334 wait_osc_import_state mds ost2 DISCONN
2335 mount_client $MOUNT || error "Unable to mount client"
2336 lctl set_param llite.$FSNAME-*.lazystatfs=0
2338 multiop_bg_pause $MOUNT _f
2342 if [ $RC1 -ne 0 ]; then
2343 log "lazystatfs multiop failed $RC1"
2346 sleep $(( $TIMEOUT+1 ))
2348 [ $? -ne 0 ] && error "process isn't sleep"
2349 start_ost2 || error "Unable to start OST2"
2350 wait $pid || error "statfs failed"
2351 stop_ost2 || error "Unable to stop OST2"
2354 umount_client $MOUNT || error "Unable to unmount client"
2355 stop_ost || error "Unable to stop OST1"
2356 stop_mds || error "Unable to stop MDS"
2357 #writeconf to remove all ost2 traces for subsequent tests
2360 run_test 50f "normal statfs one server in down =========================="
2363 [ "$OSTCOUNT" -lt "2" ] && skip_env "$OSTCOUNT < 2, skipping" && return
2365 start_ost2 || error "Unable to start OST2"
2366 wait_osc_import_state mds ost2 FULL
2367 wait_osc_import_state client ost2 FULL
2369 local PARAM="${FSNAME}-OST0001.osc.active"
2371 $LFS setstripe -c -1 $DIR/$tfile || error "Unable to lfs setstripe"
2372 do_facet mgs $LCTL conf_param $PARAM=0 || error "Unable to deactivate OST"
2374 umount_client $MOUNT || error "Unable to unmount client"
2375 mount_client $MOUNT || error "Unable to mount client"
2376 # This df should not cause a panic
2379 do_facet mgs $LCTL conf_param $PARAM=1 || error "Unable to activate OST"
2381 umount_client $MOUNT || error "Unable to unmount client"
2382 stop_ost2 || error "Unable to stop OST2"
2383 stop_ost || error "Unable to stop OST1"
2384 stop_mds || error "Unable to stop MDS"
2385 #writeconf to remove all ost2 traces for subsequent tests
2388 run_test 50g "deactivated OST should not cause panic====================="
2391 local LOCAL_TIMEOUT=20
2395 check_mount || return 1
2398 $LFS setstripe -c -1 $MOUNT/d1
2399 #define OBD_FAIL_MDS_REINT_DELAY 0x142
2400 do_facet $SINGLEMDS "lctl set_param fail_loc=0x142"
2401 touch $MOUNT/d1/f1 &
2404 start_ost2 || return 2
2406 stop_ost2 || return 3
2408 #writeconf to remove all ost2 traces for subsequent tests
2411 run_test 51 "Verify that mdt_reint handles RMF_MDT_MD correctly when an OST is added"
2420 do_node $node mkdir -p $dest
2421 [ $? -eq 0 ] || { error "Unable to create directory"; return 1; }
2423 do_node $node 'tar cf - '$@' | tar xf - -C '$dest';
2424 [ \"\${PIPESTATUS[*]}\" = \"0 0\" ] || exit 1'
2425 [ $? -eq 0 ] || { error "Unable to tar files"; return 2; }
2427 do_node $node 'getfattr -d -m "[a-z]*\\." '$@' > '$xattrs
2428 [ $? -eq 0 ] || { error "Unable to read xattrs"; return 3; }
2438 local backup2=${TMP}/backup2
2440 do_node $node mkdir -p $backup2
2441 [ $? -eq 0 ] || { error "Unable to create directory"; return 1; }
2443 do_node $node 'tar cf - '$@' | tar xf - -C '$backup2';
2444 [ \"\${PIPESTATUS[*]}\" = \"0 0\" ] || exit 1'
2445 [ $? -eq 0 ] || { error "Unable to tar files to diff"; return 2; }
2447 do_node $node "diff -rq $backup $backup2"
2448 [ $? -eq 0 ] || { error "contents differ"; return 3; }
2450 local xattrs2=${TMP}/xattrs2
2451 do_node $node 'getfattr -d -m "[a-z]*\\." '$@' > '$xattrs2
2452 [ $? -eq 0 ] || { error "Unable to read xattrs to diff"; return 4; }
2454 do_node $node "diff $xattrs $xattrs2"
2455 [ $? -eq 0 ] || { error "xattrs differ"; return 5; }
2457 do_node $node "rm -rf $backup2 $xattrs2"
2458 [ $? -eq 0 ] || { error "Unable to delete temporary files"; return 6; }
2462 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2463 skip "Only applicable to ldiskfs-based MDTs"
2468 [ $? -eq 0 ] || { error "Unable to start MDS"; return 1; }
2470 [ $? -eq 0 ] || { error "Unable to start OST1"; return 2; }
2472 [ $? -eq 0 ] || { error "Unable to mount client"; return 3; }
2475 local ost1mnt=$(facet_mntpt ost1)
2476 local ost1node=$(facet_active_host ost1)
2477 local ost1tmp=$TMP/conf52
2481 [ $? -eq 0 ] || { error "Unable to create tdir"; return 4; }
2482 touch $TMP/modified_first
2483 [ $? -eq 0 ] || { error "Unable to create temporary file"; return 5; }
2484 local mtime=$(stat -c %Y $TMP/modified_first)
2485 do_node $ost1node "mkdir -p $ost1tmp && touch -m -d @$mtime $ost1tmp/modified_first"
2487 [ $? -eq 0 ] || { error "Unable to create temporary file"; return 6; }
2490 $LFS setstripe -c -1 -S 1M $DIR/$tdir
2491 [ $? -eq 0 ] || { error "lfs setstripe failed"; return 7; }
2493 for (( i=0; i < nrfiles; i++ )); do
2494 multiop $DIR/$tdir/$tfile-$i Ow1048576w1048576w524288c
2495 [ $? -eq 0 ] || { error "multiop failed"; return 8; }
2501 echo backup files to $TMP/files
2502 local files=$(find $DIR/$tdir -type f -newer $TMP/modified_first)
2503 copy_files_xattrs `hostname` $TMP/files $TMP/file_xattrs $files
2504 [ $? -eq 0 ] || { error "Unable to copy files"; return 9; }
2506 umount_client $MOUNT
2507 [ $? -eq 0 ] || { error "Unable to umount client"; return 10; }
2509 [ $? -eq 0 ] || { error "Unable to stop ost1"; return 11; }
2511 echo mount ost1 as ldiskfs
2512 do_node $ost1node mkdir -p $ost1mnt
2513 [ $? -eq 0 ] || { error "Unable to create $ost1mnt"; return 23; }
2514 if ! do_node $ost1node test -b $ost1_dev; then
2517 do_node $ost1node mount -t $(facet_fstype ost1) $loop $ost1_dev \
2519 [ $? -eq 0 ] || { error "Unable to mount ost1 as ldiskfs"; return 12; }
2522 echo backup objects to $ost1tmp/objects
2523 local objects=$(do_node $ost1node 'find '$ost1mnt'/O/0 -type f -size +0'\
2524 '-newer '$ost1tmp'/modified_first -regex ".*\/[0-9]+"')
2525 copy_files_xattrs $ost1node $ost1tmp/objects $ost1tmp/object_xattrs $objects
2526 [ $? -eq 0 ] || { error "Unable to copy objects"; return 13; }
2528 # move objects to lost+found
2529 do_node $ost1node 'mv '$objects' '${ost1mnt}'/lost+found'
2530 [ $? -eq 0 ] || { error "Unable to move objects"; return 14; }
2533 do_node $ost1node "ll_recover_lost_found_objs -d $ost1mnt/lost+found"
2534 [ $? -eq 0 ] || { error "ll_recover_lost_found_objs failed"; return 15; }
2536 # compare restored objects against saved ones
2537 diff_files_xattrs $ost1node $ost1tmp/objects $ost1tmp/object_xattrs $objects
2538 [ $? -eq 0 ] || { error "Unable to diff objects"; return 16; }
2540 do_node $ost1node "umount $ost1mnt"
2541 [ $? -eq 0 ] || { error "Unable to umount ost1 as ldiskfs"; return 17; }
2544 [ $? -eq 0 ] || { error "Unable to start ost1"; return 18; }
2546 [ $? -eq 0 ] || { error "Unable to mount client"; return 19; }
2549 diff_files_xattrs `hostname` $TMP/files $TMP/file_xattrs $files
2550 [ $? -eq 0 ] || { error "Unable to diff files"; return 20; }
2552 rm -rf $TMP/files $TMP/file_xattrs
2553 [ $? -eq 0 ] || { error "Unable to delete temporary files"; return 21; }
2554 do_node $ost1node "rm -rf $ost1tmp"
2555 [ $? -eq 0 ] || { error "Unable to delete temporary files"; return 22; }
2558 run_test 52 "check recovering objects from lost+found"
2560 # Checks threads_min/max/started for some service
2562 # Arguments: service name (OST or MDT), facet (e.g., ost1, $SINGLEMDS), and a
2563 # parameter pattern prefix like 'ost.*.ost'.
2576 local msg="Insane $modname thread counts"
2577 local ncpts=$(check_cpt_number $facet)
2582 check_mount || return 41
2584 # We need to expand $parampat, but it may match multiple parameters, so
2585 # we'll pick the first one
2586 if ! paramp=$(do_facet $facet "lctl get_param -N ${parampat}.threads_min"|head -1); then
2587 error "Couldn't expand ${parampat}.threads_min parameter name"
2591 # Remove the .threads_min part
2592 paramp=${paramp%.threads_min}
2594 # Check for sanity in defaults
2595 tmin=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
2596 tmax=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
2597 tstarted=$(do_facet $facet "lctl get_param -n ${paramp}.threads_started" || echo 0)
2598 lassert 23 "$msg (PDSH problems?)" '(($tstarted && $tmin && $tmax))' || return $?
2599 lassert 24 "$msg" '(($tstarted >= $tmin && $tstarted <= $tmax ))' || return $?
2600 nthrs=$(expr $tmax - $tmin)
2601 if [ $nthrs -lt $ncpts ]; then
2607 [ $tmin -eq $tmax -a $tmin -eq $tstarted ] &&
2608 skip_env "module parameter forced $facet thread count" &&
2609 tmin=3 && tmax=$((3 * tmax))
2611 # Check that we can change min/max
2612 do_facet $facet "lctl set_param ${paramp}.threads_min=$((tmin + nthrs))"
2613 do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmax - nthrs))"
2614 tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
2615 tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
2616 lassert 25 "$msg" '(($tmin2 == ($tmin + $nthrs) && $tmax2 == ($tmax - $nthrs)))' || return $?
2618 # Check that we can set min/max to the same value
2619 tmin=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
2620 do_facet $facet "lctl set_param ${paramp}.threads_max=$tmin"
2621 tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
2622 tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
2623 lassert 26 "$msg" '(($tmin2 == $tmin && $tmax2 == $tmin))' || return $?
2625 # Check that we can't set max < min
2626 do_facet $facet "lctl set_param ${paramp}.threads_max=$((tmin - 1))"
2627 tmin2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min" || echo 0)
2628 tmax2=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max" || echo 0)
2629 lassert 27 "$msg" '(($tmin2 <= $tmax2))' || return $?
2631 # We need to ensure that we get the module options desired; to do this
2632 # we set LOAD_MODULES_REMOTE=true and we call setmodopts below.
2633 LOAD_MODULES_REMOTE=true
2636 local newvalue="${opts}=$(expr $basethr \* $ncpts)"
2637 setmodopts -a $modname "$newvalue" oldvalue
2641 check_mount || return 41
2643 # Restore previous setting of MODOPTS_*
2644 setmodopts $modname "$oldvalue"
2646 # Check that $opts took
2647 tmin=$(do_facet $facet "lctl get_param -n ${paramp}.threads_min")
2648 tmax=$(do_facet $facet "lctl get_param -n ${paramp}.threads_max")
2649 tstarted=$(do_facet $facet "lctl get_param -n ${paramp}.threads_started")
2650 lassert 28 "$msg" '(($tstarted == $tmin && $tstarted == $tmax ))' || return $?
2659 thread_sanity OST ost1 'ost.*.ost' 'oss_num_threads' '16'
2661 run_test 53a "check OSS thread count params"
2664 thread_sanity MDT $SINGLEMDS 'mdt.*.*.' 'mdt_num_threads' '16'
2666 run_test 53b "check MDT thread count params"
2669 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2670 skip "Only applicable to ldiskfs-based MDTs"
2674 do_rpc_nodes $(facet_host ost1) run_llverdev $(ostdevname 1) -p
2675 [ $? -eq 0 ] || error "llverdev failed!"
2678 run_test 54a "test llverdev and partial verify of device"
2681 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2682 skip "Only applicable to ldiskfs-based MDTs"
2687 run_llverfs $MOUNT -p
2688 [ $? -eq 0 ] || error "llverfs failed!"
2691 run_test 54b "test llverfs and partial verify of filesystem"
2695 local max_ost_index=$1
2696 echo -n $(((max_ost_index + 1) * 8))
2700 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2701 skip "Only applicable to ldiskfs-based MDTs"
2705 local mdsdev=$(mdsdevname 1)
2706 local mdsvdev=$(mdsvdevname 1)
2710 add mds1 $(mkfs_opts mds1) --reformat $mdsdev $mdsvdev ||
2712 add ost1 $(mkfs_opts ost1) --index=$i --reformat \
2713 $(ostdevname 1) $(ostvdevname 1)
2719 echo checking size of lov_objid for ost index $i
2720 LOV_OBJID_SIZE=$(do_facet mds1 "$DEBUGFS -R 'stat lov_objid' $mdsdev 2>/dev/null" | grep ^User | awk '{print $6}')
2721 if [ "$LOV_OBJID_SIZE" != $(lov_objid_size $i) ]; then
2722 error "lov_objid size has to be $(lov_objid_size $i), not $LOV_OBJID_SIZE"
2724 echo ok, lov_objid size is correct: $LOV_OBJID_SIZE
2731 run_test 55 "check lov_objid size"
2734 local mds_journal_size_orig=$MDSJOURNALSIZE
2737 add mds1 $(mkfs_opts mds1) --reformat $(mdsdevname 1) $(mdsvdevname 1)
2738 add ost1 $(mkfs_opts ost1) --index=1000 --reformat \
2739 $(ostdevname 1) $(ostvdevname 1)
2740 add ost2 $(mkfs_opts ost2) --index=10000 --reformat \
2741 $(ostdevname 2) $(ostvdevname 2)
2745 start_ost2 || error "Unable to start second ost"
2746 mount_client $MOUNT || error "Unable to mount client"
2750 MDSJOURNALSIZE=$mds_journal_size_orig
2753 run_test 56 "check big indexes"
2755 test_57a() { # bug 22656
2756 local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
2758 do_facet ost1 "$TUNEFS --failnode=$NID `ostdevname 1`" || error "tunefs failed"
2760 start_ost && error "OST registration from failnode should fail"
2763 run_test 57a "initial registration from failnode should fail (should return errs)"
2766 local NID=$(do_facet ost1 "$LCTL get_param nis" | tail -1 | awk '{print $1}')
2768 do_facet ost1 "$TUNEFS --servicenode=$NID `ostdevname 1`" || error "tunefs failed"
2770 start_ost || error "OST registration from servicenode should not fail"
2773 run_test 57b "initial registration from servicenode should not fail"
2776 do_facet mgs $LCTL get_param mgs.MGS.live.$FSNAME | grep OST | wc -l
2779 test_58() { # bug 22658
2780 if [ $(facet_fstype mds) != ldiskfs ]; then
2781 skip "Only applicable to ldiskfs-based MDTs"
2786 createmany -o $DIR/$tdir/$tfile-%d 100
2787 # make sure that OSTs do not cancel llog cookies before we unmount the MDS
2788 #define OBD_FAIL_OBD_LOG_CANCEL_NET 0x601
2789 do_facet mds "lctl set_param fail_loc=0x601"
2790 unlinkmany $DIR/$tdir/$tfile-%d 100
2792 local MNTDIR=$(facet_mntpt mds)
2793 # remove all files from the OBJECTS dir
2794 do_facet mds "mount -t ldiskfs $MDSDEV $MNTDIR"
2795 do_facet mds "find $MNTDIR/OBJECTS -type f -delete"
2796 do_facet mds "umount $MNTDIR"
2797 # restart MDS with missing llog files
2799 do_facet mds "lctl set_param fail_loc=0"
2802 run_test 58 "missing llog files must not prevent MDT from mounting"
2805 start_mgsmds >> /dev/null
2806 local C1=$(count_osts)
2807 if [ $C1 -eq 0 ]; then
2808 start_ost >> /dev/null
2812 echo "original ost count: $C1 (expect > 0)"
2813 [ $C1 -gt 0 ] || error "No OSTs in $FSNAME log"
2814 start_mgsmds -o writeconf >> /dev/null || error "MDT start failed"
2815 local C2=$(count_osts)
2816 echo "after mdt writeconf count: $C2 (expect 0)"
2817 [ $C2 -gt 0 ] && error "MDT writeconf should erase OST logs"
2818 echo "OST start without writeconf should fail:"
2819 start_ost >> /dev/null && error "OST start without writeconf didn't fail"
2820 echo "OST start with writeconf should succeed:"
2821 start_ost -o writeconf >> /dev/null || error "OST1 start failed"
2822 local C3=$(count_osts)
2823 echo "after ost writeconf count: $C3 (expect 1)"
2824 [ $C3 -eq 1 ] || error "new OST writeconf should add:"
2825 start_ost2 -o writeconf >> /dev/null || error "OST2 start failed"
2826 local C4=$(count_osts)
2827 echo "after ost2 writeconf count: $C4 (expect 2)"
2828 [ $C4 -eq 2 ] || error "OST2 writeconf should add log"
2829 stop_ost2 >> /dev/null
2830 cleanup_nocli >> /dev/null
2831 #writeconf to remove all ost2 traces for subsequent tests
2834 run_test 59 "writeconf mount option"
2836 test_60() { # LU-471
2837 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2838 skip "Only applicable to ldiskfs-based MDTs"
2842 add mds1 $(mkfs_opts mds1) \
2843 --mkfsoptions='\" -E stride=64 -O ^uninit_bg\"' --reformat \
2844 $(mdsdevname 1) $(mdsvdevname 1) || exit 10
2846 dump=$(do_facet $SINGLEMDS dumpe2fs $(mdsdevname 1))
2848 [ $rc -eq 0 ] || error "dumpe2fs $(mdsdevname 1) failed"
2850 # MDT default has dirdata feature
2851 echo $dump | grep dirdata > /dev/null || error "dirdata is not set"
2852 # we disable uninit_bg feature
2853 echo $dump | grep uninit_bg > /dev/null && error "uninit_bg is set"
2854 # we set stride extended options
2855 echo $dump | grep stride > /dev/null || error "stride is not set"
2858 run_test 60 "check mkfs.lustre --mkfsoptions -E -O options setting"
2861 local reformat=false
2863 [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.1.53) ] ||
2864 { skip "Need MDS version at least 2.1.53"; return 0; }
2866 if [ $(facet_fstype $SINGLEMDS) == ldiskfs ] &&
2867 ! large_xattr_enabled; then
2869 local mds_dev=$(mdsdevname ${SINGLEMDS//mds/})
2870 LDISKFS_MKFS_OPTS+=" -O large_xattr"
2871 add $SINGLEMDS $(mkfs_opts $SINGLEMDS) --reformat $mds_dev ||
2872 error "reformatting $mds_dev failed"
2875 setup_noconfig || error "setting up the filesystem failed"
2876 client_up || error "starting client failed"
2878 local file=$DIR/$tfile
2881 local large_value="$(generate_string $(max_xattr_size))"
2882 local small_value="bar"
2884 local name="trusted.big"
2885 log "save large xattr $name on $file"
2886 setfattr -n $name -v $large_value $file ||
2887 error "saving $name on $file failed"
2889 local new_value=$(get_xattr_value $name $file)
2890 [[ "$new_value" != "$large_value" ]] &&
2891 error "$name different after saving"
2893 log "shrink value of $name on $file"
2894 setfattr -n $name -v $small_value $file ||
2895 error "shrinking value of $name on $file failed"
2897 new_value=$(get_xattr_value $name $file)
2898 [[ "$new_value" != "$small_value" ]] &&
2899 error "$name different after shrinking"
2901 log "grow value of $name on $file"
2902 setfattr -n $name -v $large_value $file ||
2903 error "growing value of $name on $file failed"
2905 new_value=$(get_xattr_value $name $file)
2906 [[ "$new_value" != "$large_value" ]] &&
2907 error "$name different after growing"
2909 log "check value of $name on $file after remounting MDS"
2911 new_value=$(get_xattr_value $name $file)
2912 [[ "$new_value" != "$large_value" ]] &&
2913 error "$name different after remounting MDS"
2915 log "remove large xattr $name from $file"
2916 setfattr -x $name $file || error "removing $name from $file failed"
2921 LDISKFS_MKFS_OPTS=${LDISKFS_MKFS_OPTS% -O large_xattr}
2925 run_test 61 "large xattr"
2928 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2929 skip "Only applicable to ldiskfs-based MDTs"
2934 local mdsdev=$(mdsdevname 1)
2935 local ostdev=$(ostdevname 1)
2937 [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.2.51) ]] ||
2938 { skip "Need MDS version at least 2.2.51"; return 0; }
2940 echo "disable journal for mds"
2941 do_facet mds tune2fs -O ^has_journal $mdsdev || error "tune2fs failed"
2942 start_mds && error "MDT start should fail"
2943 echo "disable journal for ost"
2944 do_facet ost1 tune2fs -O ^has_journal $ostdev || error "tune2fs failed"
2945 start_ost && error "OST start should fail"
2946 cleanup || return $?
2949 run_test 62 "start with disabled journal"
2952 if [ $(facet_fstype $SINGLEMDS) != ldiskfs ]; then
2953 skip "Only applicable to ldiskfs-based MDTs"
2957 local inode_slab=$(do_facet $SINGLEMDS \
2958 "awk '/ldiskfs_inode_cache/ { print \\\$5 }' /proc/slabinfo")
2959 if [ -z "$inode_slab" ]; then
2960 skip "ldiskfs module has not been loaded"
2964 echo "$inode_slab ldisk inodes per page"
2965 [ "$inode_slab" -ge "3" ] ||
2966 error "ldisk inode size is too big, $inode_slab objs per page"
2969 run_test 63 "Verify each page can at least hold 3 ldisk inodes"
2974 start_ost2 || error "Unable to start second ost"
2975 mount_client $MOUNT || error "Unable to mount client"
2976 stop_ost2 || error "Unable to stop second ost"
2978 $LFS df --lazy || error "lfs df failed"
2979 cleanup || return $?
2981 run_test 64 "check lfs df --lazy "
2983 if ! combined_mgs_mds ; then
2989 complete $(basename $0) $SECONDS