run_test 56b "check $LFS getdirstripe"
test_56c() {
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
local ost_idx=0
local ost_name=$(ostname_from_index $ost_idx)
local old_status=$(ost_dev_status $ost_idx)
$LFS setdirstripe -c$MDSCOUNT $dir/striped_dir
createmany -o $dir/striped_dir/${tfile}- 1024
- local dirs=$(lfs find --size +8k $dir/)
+ local dirs=$($LFS find --size +8k $dir/)
[ -n "$dirs" ] || error "lfs find --size wrong under striped dir"
}
run_test 56aa "lfs find --size under striped dir"
+test_56ab() { # LU-10705
+ test_mkdir $DIR/$tdir
+ dd if=/dev/zero of=$DIR/$tdir/$tfile.1 bs=8k count=1 seek=2k
+ dd if=/dev/zero of=$DIR/$tdir/$tfile.2 bs=4k count=1 seek=4k
+ dd if=/dev/zero of=$DIR/$tdir/$tfile.3 bs=1M count=2 seek=16
+ # Flush writes to ensure valid blocks. Need to be more thorough for
+ # ZFS, since blocks are not allocated/returned to client immediately.
+ sync_all_data
+ wait_zfs_commit ost1 2
+ cancel_lru_locks osc
+ ls -ls $DIR/$tdir
+
+ local files=$($LFS find --size +16M $DIR/$tdir | wc -l)
+
+ [[ $files == 3 ]] || error ">16M size files $files isn't 3 as expected"
+
+ files=$($LFS find --blocks +1M $DIR/$tdir | wc -l)
+ [[ $files == 1 ]] || error ">1M blocks files $files isn't 1 as expected"
+
+ rm -f $DIR/$tdir/$tfile.[123]
+}
+run_test 56ab "lfs find --blocks"
+
test_56ba() {
# Create composite files with one component
local dir=$DIR/$tdir
run_test 60a "llog_test run from kernel module and test llog_reader"
test_60aa() {
+ remote_mgs_nodsh && skip "remote MGS with nodsh" && return
+
# test old logid format
if [ $(lustre_version_code mgs) -le $(version_code 3.1.53) ]; then
do_facet mgs $LCTL dl | grep MGS
}
test_77c() {
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
$GSS && skip "could not run with gss" && return
}
test_101g() {
+ remote_ost_nodsh && skip "remote OST with nodsh" && return
+
local rpcs
local osts=$(get_facets OST)
local list=$(comma_list $(osts_nodes))
run_test 160e "changelog negative testing (should return errors)"
test_160f() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.56) ]] ||
+ { skip "Need MDS version at least 2.10.56"; return 0; }
+
local mdts=$(comma_list $(mdts_nodes))
# Create a user
run_test 160f "changelog garbage collect (timestamped users)"
test_160g() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+ [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.56) ]] ||
+ { skip "Need MDS version at least 2.10.56"; return 0; }
+
local mdts=$(comma_list $(mdts_nodes))
#define OBD_FAIL_TIME_IN_CHLOG_USER 0x1314
run_test 161c "check CL_RENME[UNLINK] changelog record flags"
test_161d() {
+ remote_mds_nodsh && skip "remote MDS with nodsh" && return
+
local pid
local fid
run_test 232a "failed lock should not block umount"
test_232b() {
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.58) ] ||
+ { skip "Need MDS version at least 2.10.58"; return; }
mkdir -p $DIR/$tdir
$LFS setstripe -c1 -i0 $DIR/$tdir/$tfile
dd if=/dev/zero of=$DIR/$tdir/$tfile bs=1M count=1
}
run_test 804 "verify agent entry for remote entry"
+cleanup_805() {
+ do_facet $SINGLEMDS zfs set quota=$old $fsset
+ unlinkmany $DIR/$tdir/f- 1000000
+ trap 0
+}
+
+test_805() {
+ local zfs_version=$(do_node $SINGLEMDS cat /sys/module/zfs/version)
+ [ "$(facet_fstype mds1)" != "zfs" ] &&
+ skip "ZFS specific test" && return
+ [ $(version_code $zfs_version) -lt $(version_code 0.7.2) ] &&
+ skip "netfree not implemented before 0.7" && return
+ [[ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.10.57) ]] ||
+ { skip "Need MDS version at least 2.10.57" && return 0; }
+
+ local fsset
+ local freekb
+ local usedkb
+ local old
+ local quota
+ local pref="osd-zfs.lustre-MDT0000."
+
+ # limit available space on MDS dataset to meet nospace issue
+ # quickly. then ZFS 0.7.2 can use reserved space if asked
+ # properly (using netfree flag in osd_declare_destroy()
+ fsset=$(do_facet $SINGLEMDS lctl get_param -n $pref.mntdev)
+ old=$(do_facet $SINGLEMDS zfs get -H quota $fsset | \
+ gawk '{print $3}')
+ freekb=$(do_facet $SINGLEMDS lctl get_param -n $pref.kbytesfree)
+ usedkb=$(do_facet $SINGLEMDS lctl get_param -n $pref.kbytestotal)
+ let "usedkb=usedkb-freekb"
+ let "freekb=freekb/2"
+ if let "freekb > 5000"; then
+ let "freekb=5000"
+ fi
+ do_facet $SINGLEMDS zfs set quota=$(((usedkb+freekb)*1024)) $fsset
+ trap cleanup_805 EXIT
+ mkdir $DIR/$tdir
+ $LFS setstripe -E 1M -L mdt $DIR/$tdir || error "DoM not working"
+ createmany -m $DIR/$tdir/f- 1000000 && error "ENOSPC wasn't met"
+ rm -rf $DIR/$tdir || error "not able to remove"
+ do_facet $SINGLEMDS zfs set quota=$old $fsset
+ trap 0
+}
+run_test 805 "ZFS can remove from full fs"
+
#
# tests that do cleanup/setup should be run at the end
#