has_warning=0
rm -rf $DIR/$tdir
- test_mkdir -p $DIR/$tdir
+ mkdir -p $DIR/$tdir
# block size of mds1
local MDT_DEV=$(mdsdevname ${SINGLEMDS//mds/})
set_dir_limits $MAX $MAX
local I=$(stat -c%s "$DIR/$tdir")
local J=0
- local STRIPE_COUNT=1
- [[ $MDSCOUNT -ge 2 ]] && STRIPE_COUNT=$($LFS getdirstripe -c $DIR/$tdir)
- MAX=$((MAX*STRIPE_COUNT))
while [[ $I -le $MAX ]]; do
$MULTIOP $DIR/$tdir/$J Oc
rc=$?
if [ $rc -eq $EFBIG -o $rc -eq $ENOSPC ]; then
set_dir_limits 0 0
echo "return code $rc received as expected"
- multiop $DIR/$tdir/$J Oc ||
- error_exit "multiop failed w/o dir size limit"
+
+ createmany -o $DIR/$tdir/$J_file_ 1000 ||
+ error_exit "create failed w/o dir size limit"
check_mds_dmesg '"has reached"' ||
error_exit "has reached message should be output"
cmd="dd if=/dev/zero of=$DIR/$tfile bs=1M count=1 oflag=sync"
verify_jobstats "$cmd" "ost1"
# read
+ cancel_lru_locks osc
cmd="dd if=$DIR/$tfile of=/dev/null bs=1M count=1 iflag=direct"
verify_jobstats "$cmd" "ost1"
# truncate
}
run_test 252 "check lr_reader tool"
+test_256() {
+ local cl_user
+ local cat_sl
+ local mdt_dev
+
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ [ "$(facet_fstype mds1)" != "ldiskfs" ] &&
+ skip "non-ldiskfs backend" && return
+
+ mdt_dev=$(mdsdevname 1)
+ echo $mdt_dev
+ cl_user=$(do_facet mds1 \
+ "$LCTL get_param -n mdd.$MDT0.changelog_users | grep cl")
+ if [[ -n $cl_user ]]; then
+ skip "active changelog user"
+ return
+ fi
+
+ cl_user=$(do_facet mds1 $LCTL --device $MDT0 changelog_register -n)
+ echo "Registered as changelog user $cl_user"
+
+ rm -rf $DIR/$tdir
+ mkdir -p $DIR/$tdir
+
+ $LFS changelog_clear $MDT0 $cl_user 0
+
+ # change something
+ touch $DIR/$tdir/{1..10}
+
+ # stop the MDT
+ stop mds1 || error "Fail to stop MDT."
+
+ # remount the MDT
+ start mds1 $mdt_dev $MDS_MOUNT_OPTS || error "Fail to start MDT."
+
+ #after mount new plainllog is used
+ touch $DIR/$tdir/{11..19}
+ cat_sl=$(do_facet mds1 \
+ "$DEBUGFS -R \\\"dump changelog_catalog cat.dmp\\\" $mdt_dev; \
+ llog_reader cat.dmp | grep \\\"type=1064553b\\\" | wc -l")
+
+ if (( cat_sl != 2 )); then
+ do_facet mds1 $LCTL --device $MDT0 changelog_deregister $cl_user
+ error "Changelog catalog has wrong number of slots $cat_sl"
+ fi
+
+ $LFS changelog_clear $MDT0 $cl_user 0
+
+ cat_sl=$(do_facet mds1 \
+ "$DEBUGFS -R \\\"dump changelog_catalog cat.dmp\\\" $mdt_dev; \
+ llog_reader cat.dmp | grep \\\"type=1064553b\\\" | wc -l")
+
+ do_facet mds1 $LCTL --device $MDT0 changelog_deregister $cl_user
+
+ if (( cat_sl == 2 )); then
+ error "Empty plain llog was not deleted from changelog catalog"
+ fi
+ if (( cat_sl != 1 )); then
+ error "Active plain llog shouldn\`t be deleted from catalog"
+ fi
+}
+run_test 256 "Check llog delete for empty and not full state"
cleanup_test_300() {
trap 0
}
run_test 300p "create striped directory without space"
+test_300q() {
+ [ $PARALLEL == "yes" ] && skip "skip parallel run" && return
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return
+
+ local fd=$(free_fd)
+ local cmd="exec $fd<$tdir"
+ cd $DIR
+ $LFS mkdir -c $MDSCOUNT $tdir || error "create $tdir fails"
+ eval $cmd
+ cmd="exec $fd<&-"
+ trap "eval $cmd" EXIT
+ cd $tdir || error "cd $tdir fails"
+ rmdir ../$tdir || error "rmdir $tdir fails"
+ mkdir local_dir && error "create dir succeeds"
+ $LFS setdirstripe -i1 remote_dir && error "create remote dir succeeds"
+ eval $cmd
+ return 0
+}
+run_test 300q "create remote directory under orphan directory"
+
prepare_remote_file() {
mkdir $DIR/$tdir/src_dir ||
error "create remote source failed"
}
run_test 400b "packaged headers can be compiled"
-test_401() { #LU-7437
+test_401a() { #LU-7437
#count the number of parameters by "list_param -R"
local params=$($LCTL list_param -R '*' 2>/dev/null | wc -l)
#count the number of parameters by listing proc files
- local procs=$(find -L $proc_dirs -mindepth 1 -printf '%P\n' 2>/dev/null |
+ local procs=$(find -L $proc_dirs -mindepth 1 -printf '%P\n' 2>/dev/null|
sort -u | wc -l)
[ $params -eq $procs ] ||
error "found $params parameters vs. $procs proc files"
+
+ # test the list_param -D option only returns directories
+ params=$($LCTL list_param -R -D '*' 2>/dev/null | wc -l)
+ #count the number of parameters by listing proc directories
+ procs=$(find -L $proc_dirs -mindepth 1 -type d -printf '%P\n' 2>/dev/null |
+ sort -u | wc -l)
+
+ [ $params -eq $procs ] ||
+ error "found $params parameters vs. $procs proc files"
+}
+run_test 401a "Verify if 'lctl list_param -R' can list parameters recursively"
+
+test_401b() {
+ local save=$($LCTL get_param -n jobid_var)
+ local tmp=testing
+
+ $LCTL set_param foo=bar jobid_var=$tmp bar=baz &&
+ error "no error returned when setting bad parameters"
+
+ local jobid_new=$($LCTL get_param -n foe jobid_var baz)
+ [[ "$jobid_new" == "$tmp" ]] || error "jobid tmp $jobid_new != $tmp"
+
+ $LCTL set_param -n fog=bam jobid_var=$save bat=fog
+ local jobid_old=$($LCTL get_param -n foe jobid_var bag)
+ [[ "$jobid_old" == "$save" ]] || error "jobid new $jobid_old != $save"
}
-run_test 401 "Verify if 'lctl list_param -R' can list parameters recursively"
+run_test 401b "Verify 'lctl {get,set}_param' continue after error"
test_402() {
$LFS setdirstripe -i 0 $DIR/$tdir || error "setdirstripe -i 0 failed"