ALWAYS_EXCEPT="$SANITY_EXCEPT 42a 42b 42c"
# UPDATE THE COMMENT ABOVE WITH BUG NUMBERS WHEN CHANGING ALWAYS_EXCEPT!
-# skipped tests: LU-8411 LU-9096 LU-9054
-ALWAYS_EXCEPT=" 407 253 312 $ALWAYS_EXCEPT"
+# skipped tests: LU-8411 LU-9096 LU-9054 LU-10680 ..
+ALWAYS_EXCEPT=" 407 253 312 160f 160g $ALWAYS_EXCEPT"
# Check Grants after these tests
GRANT_CHECK_LIST="$GRANT_CHECK_LIST 42a 42b 42c 42d 42e 63a 63b 64a 64b 64c"
MEMHOG=${MEMHOG:-memhog}
DIRECTIO=${DIRECTIO:-directio}
ACCEPTOR_PORT=${ACCEPTOR_PORT:-988}
-STRIPES_PER_OBJ=-1
+DEF_STRIPE_COUNT=-1
CHECK_GRANT=${CHECK_GRANT:-"yes"}
GRANT_CHECK_LIST=${GRANT_CHECK_LIST:-""}
export PARALLEL=${PARALLEL:-"no"}
error "stripe count $($GETSTRIPE -c $MOUNT) != 1"
local default_size=$($GETSTRIPE -S $MOUNT)
local default_offset=$($GETSTRIPE -i $MOUNT)
- local dsize=$((1024 * 1024))
+ local dsize=$(do_facet $SINGLEMDS \
+ "$LCTL get_param -n lod.$(facet_svc $SINGLEMDS)*.stripesize")
[ $default_size -eq $dsize ] ||
error "stripe size $default_size != $dsize"
[ $default_offset -eq -1 ] ||error "stripe offset $default_offset != -1"
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)
setup_56 $dir 0 $NUMDIRS
for i in $(seq $NUMDIRS); do
- $LFS setstripe -S 4M $dir/dir$i/$tfile
+ $LFS setstripe -S 8M $dir/dir$i/$tfile
done
local expected=$NUMDIRS
- local cmd="$LFS find -S 4M $dir"
+ local cmd="$LFS find -S 8M $dir"
local nums=$($cmd | wc -l)
[ $nums -eq $expected ] || {
echo -n "Creating test dir..."
test_mkdir $DIR/$tdir &> /dev/null || error "cannot create dir"
+ local def_stripe_size=$($LFS getstripe -S $DIR/$tdir 2>/dev/null)
$LFS setstripe -S 1M -c 1 "$DIR/$tdir" &> /dev/null ||
error "cannot set stripe"
echo "done"
echo -n "Verifying restripe option uses parent stripe settings..."
$LFS_MIGRATE -y -R "$file1" &> /dev/null ||
error "migrate failed"
- [ $($LFS getstripe -S "$file1") -eq 1048576 ] ||
+ [ $($LFS getstripe -S "$file1") -eq $def_stripe_size ] ||
error "file not restriped to parent settings"
[ $($LFS getstripe -c "$file1") -eq 1 ] ||
error "file not restriped to parent settings"
# Ensure striping is preserved if -R is not set, and no stripe
# count or size is specified
echo -n "Verifying striping size preserved when not specified..."
+ local orig_stripe_size=$($LFS getstripe -S "$file1" 2>/dev/null)
$LFS setstripe -S 2M -c 1 "$DIR/$tdir" &> /dev/null ||
error "cannot set stripe on parent directory"
$LFS_MIGRATE -y "$file1" &> /dev/null ||
error "migrate failed"
- [ $($LFS getstripe -S "$file1") -eq 1048576 ] ||
+ [ $($LFS getstripe -S "$file1") -eq $orig_stripe_size ] ||
error "file was restriped"
echo "done."
$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
- setup_56 $dir/1Mfiles 5 1 "--component-end 1M"
+ setup_56 $dir/1Mfiles 5 1 "-S 1M --component-end 1M"
# Create composite files with three components
- setup_56 $dir/2Mfiles 5 2 "-E 2M -E 4M -E 6M"
+ setup_56 $dir/2Mfiles 5 2 "-E 2M -S 1M -E 4M -E 6M"
# Create non-composite files
createmany -o $dir/${tfile}- 10
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 315 "read should be accounted"
+test_316() {
+ [ $MDSCOUNT -lt 2 ] && skip "needs >= 2 MDTs" && return 0
+ large_xattr_enabled || { skip "large_xattr disabled" && return; }
+
+ rm -rf $DIR/$tdir/d
+ mkdir -p $DIR/$tdir/d
+ chown nobody $DIR/$tdir/d
+ touch $DIR/$tdir/d/file
+
+ $LFS mv -M1 $DIR/$tdir/d || error "lfs mv failed"
+}
+run_test 316 "lfs mv"
+
test_fake_rw() {
local read_write=$1
if [ "$read_write" = "write" ]; then
}
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
#