# and stop to generate the startup logs.
start_mds
start_ost
- wait_osc_import_state mds ost FULL
+ wait_osc_import_state mds ost FULL
stop_ost
stop_mds
}
}
reformat() {
- formatall
+ formatall
}
start_mgs () {
for num in $(seq $MDSCOUNT); do
start_mdt $num $@ || return 94
done
+ for num in $(seq $MDSCOUNT); do
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} mds${num} FULL
+ done
}
start_mgsmds() {
}
stop_mgs() {
- echo "stop mgs service on `facet_active_host mgs`"
- # These tests all use non-failover stop
- stop mgs -f || return 97
+ echo "stop mgs service on `facet_active_host mgs`"
+ # These tests all use non-failover stop
+ stop mgs -f || return 97
}
start_ost() {
echo "start ost1 service on `facet_active_host ost1`"
start ost1 $(ostdevname 1) $OST_MOUNT_OPTS $@ || return 95
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} ost1 FULL
}
stop_ost() {
start_ost2() {
echo "start ost2 service on `facet_active_host ost2`"
start ost2 $(ostdevname 2) $OST_MOUNT_OPTS $@ || return 92
+ wait_clients_import_state ${CLIENTS:-$HOSTNAME} ost2 FULL
}
stop_ost2() {
do_facet client "cp /etc/passwd $DIR/a" || return 71
do_facet client "rm $DIR/a" || return 72
# make sure lustre is actually mounted (touch will block,
- # but grep won't, so do it after)
- do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
+ # but grep won't, so do it after)
+ do_facet client "grep $MOUNT' ' /proc/mounts > /dev/null" || return 73
echo "setup single mount lustre success"
}
local writeconf=$2
local dne_upgrade=${dne_upgrade:-"no"}
local dom_upgrade=${dom_upgrade:-"no"}
+ local project_upgrade=${project_upgrade:-"no"}
local ff_convert=${ff_convert:-"no"}
local shall_cleanup_mdt=false
local shall_cleanup_mdt1=false
error_noexit "import zfs pool failed"
return 1
}
+ elif [ "$project_upgrade" != "no" ]; then
+ ! $r tune2fs -O project $mdt_dev &&
+ error_noexit "enable project on mdt0 failed" &&
+ return 1
+ $mdt2_is_available && ! $r tune2fs "-O project" $mdt2_dev &&
+ error_noexit "enable project on mdt failed" &&
+ return 1
+ ! $r tune2fs -O project $ost_dev &&
+ error_noexit "enable project on mdt failed" &&
+ return 1
fi
$r $LCTL set_param debug="$PTLDEBUG"
return 1
}
+ if [ "$mds1_FSTYPE" == ldiskfs -a \
+ "$project_upgrade" != "no" ]; then
+ ! $LFS project -d -p 1 $tmp/mnt/lustre/* &&
+ error_noexit "set project failed" &&
+ return 1
+ fi
+
[[ $(do_facet mds1 pgrep orph_.*-MDD | wc -l) == 0 ]] ||
error "MDD orphan cleanup thread not quit"
t32_check
for tarball in $tarballs; do
- banner "testing $tarball upgrade with ff convert"
- ff_convert=yes t32_test $tarball || rc=$?
+ banner "testing $tarball upgrade with ff convert and project upgrade"
+ project_upgrade="no"
+ [[ "$MDS1_VERSION" -ge $(version_code 2.13.54) ]] &&
+ [[ "$tarball" =~ "disk2_4-ldiskfs" ]] &&
+ project_upgrade="yes"
+ project_upgrade=$project_upgrade ff_convert=yes t32_test \
+ $tarball || rc=$?
done
return $rc
}
-run_test 32d "convert ff test"
+run_test 32d "convert ff and project quota upgrade test"
test_32e() {
[[ "$MDS1_VERSION" -ge $(version_code 2.10.56) ]] ||
skip "ldiskfs module has not been loaded"
fi
+ if grep -q "CONFIG_DEBUG_LOCK_ALLOC=y" /boot/config-$(uname -r); then
+ skip "test is not compatible with CONFIG_DEBUG_LOCK_ALLOC=y"
+ fi
+
echo "$inode_slab ldiskfs inodes per page"
[ "${inode_slab%.*}" -ge "3" ] && return 0
}
run_test 123ae "llog_cancel can cancel requested record"
+test_123af() { #LU-13609
+ [ "$MGS_VERSION" -ge $(version_code 2.13.54) -a \
+ "$MDS1_VERSION" -ge $(version_code 2.13.54) ] ||
+ skip "Need both MGS and MDS version at least 2.13.54"
+
+ [ -d $MOUNT/.lustre ] || setupall
+ stack_trap "do_facet mds1 $LCTL set_param fail_loc=0" EXIT
+
+ local device
+ local facet
+ local cmd
+ local orig_clist
+ local orig_count
+ local new_clist
+ local new_count
+
+ for device in "MGS" "$FSNAME-MDT0000"; do
+ cmd="--device $device llog_catlist"
+ echo "lctl $cmd ..."
+ if [ "$device" = "MGS" ]; then
+ facet="mgs"
+ else
+ facet="mds1"
+ fi
+ orig_clist=($(do_facet $facet $LCTL $cmd | awk '{ print $2 }'))
+ orig_count=${#orig_clist[@]}
+ echo "orig_clist: ${orig_clist[@]}"
+
+ #define OBD_FAIL_CATLIST 0x131b
+ #fetch to llog records from the second one
+ do_facet $facet $LCTL set_param fail_loc=0x131b fail_val=2
+
+ new_clist=($(do_facet $facet $LCTL $cmd | awk '{ print $2 }'))
+ new_count=${#new_clist[@]}
+ echo "new_clist: ${new_clist[@]}"
+
+ [ $new_count -eq $((orig_count - 1)) ] ||
+ error "$new_count != $orig_count - 1"
+ for i in $(seq 0 $new_count); do
+ j=$((i + 1))
+ [ "${orig_clist[$j]}" = "${new_clist[$i]}" ] ||
+ error "${orig_clist[$j]} != ${new_clist[$i]}"
+ done
+ do_facet mds1 $LCTL set_param fail_loc=0
+ echo "done"
+ done
+}
+run_test 123af "llog_catlist can show all config files correctly"
+
test_123F() {
remote_mgs_nodsh && skip "remote MGS with nodsh"
}
run_test 126 "mount in parallel shouldn't cause a crash"
+test_127() {
+ [[ "$ost1_FSTYPE" == ldiskfs ]] || skip "ldiskfs only test"
+
+ cleanup
+ setup
+ zconf_umount_clients $RCLIENTS $MOUNT
+
+ wait_osp_active ost ${FSNAME}-OST0000 0 1
+ local osc_tgt="$FSNAME-OST0000-osc-$($LFS getname -i $DIR)"
+ local avail1=($($LCTL get_param -n osc.${osc_tgt}.kbytesavail))
+
+ $LFS setstripe -i 0 $DIR/$tfile || error "failed creating $DIR/$tfile"
+ dd if=/dev/zero of=$DIR/$tfile bs=1M oflag=direct || true
+
+ local avail2=($($LCTL get_param -n osc.${osc_tgt}.kbytesavail))
+
+ if ((avail2 * 100 / avail1 > 1)); then
+ lfs df $DIR
+ ls -l $DIR/$tfile
+ error "more than 1% space left: before=$avail1 after=$avail2"
+ fi
+
+ local mbs=$(($(stat -c %s $DIR/$tfile) / (1024 * 1024)))
+
+ dd if=/dev/zero of=$DIR/$tfile bs=1M count=$mbs conv=notrunc \
+ oflag=direct || error "overwrite failed"
+}
+run_test 127 "direct io overwrite on full ost"
+
if ! combined_mgs_mds ; then
stop mgs
fi