test_29() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return 0
- cancel_lru_locks mdc
+ cancel_lru_locks
test_mkdir $DIR/d29
touch $DIR/d29/foo
log 'first d29'
}
run_test 51a "special situations: split htree with empty entry =="
-export NUMTEST=70000
test_51b() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
- local BASE=$DIR/d${base}.${TESTSUITE}
+ local dir=$DIR/$tdir
+
+ local nrdirs=$((65536 + 100))
# cleanup the directory
- rm -fr $BASE
+ rm -fr $dir
- test_mkdir -p -c1 $BASE
+ test_mkdir -p -c1 $dir
$LFS df
$LFS df -i
- local mdtidx=$(printf "%04x" $($LFS getstripe -M $BASE))
+ local mdtidx=$(printf "%04x" $($LFS getstripe -M $dir))
local numfree=$(lctl get_param -n mdc.$FSNAME-MDT$mdtidx*.filesfree)
- [[ $numfree -lt 21000 ]] &&
+ [[ $numfree -lt $nrdirs ]] &&
skip "not enough free inodes ($numfree) on MDT$mdtidx" &&
return
- [[ $numfree -lt $NUMTEST ]] && NUMTEST=$(($numfree - 50)) &&
- echo "reduced count to $NUMTEST due to inodes on MDT$mdtidx"
-
# need to check free space for the directories as well
local blkfree=$(lctl get_param -n mdc.$FSNAME-MDT$mdtidx*.kbytesavail)
numfree=$((blkfree / 4))
- [[ $numfree -lt $NUMTEST ]] && NUMTEST=$((numfree - 50)) &&
- echo "reduced count to $NUMTEST due to blocks on MDT$mdtidx"
-
- createmany -d $BASE/d $NUMTEST && echo $NUMTEST > $BASE/fnum ||
- {
- $LFS df
- $LFS df -i
- echo "failed" > $BASE/fnum
- error "failed to create $NUMTEST subdirs in MDT$mdtidx:$BASE"
- }
-}
-run_test 51b "exceed 64k subdirectory nlink limit"
+ [[ $numfree -lt $nrdirs ]] && skip "not enough blocks ($numfree)" &&
+ return
-test_51ba() { # LU-993
- local BASE=$DIR/d${base}.${TESTSUITE}
- # unlink all but 100 subdirectories, then check it still works
- local LEFT=100
- [ -f $BASE/fnum ] && local NUMPREV=$(cat $BASE/fnum) && rm $BASE/fnum
+ # create files
+ createmany -d $dir/d $nrdirs ||
+ error "failed to create $nrdirs subdirs in MDT$mdtidx:$dir"
- [ "$NUMPREV" != "failed" ] && NUMTEST=$NUMPREV
- local DELETE=$((NUMTEST - LEFT))
+ # really created :
+ nrdirs=$(ls -U $dir | wc -l)
- # continue on to run this test even if 51b didn't finish,
- # just to delete the many subdirectories created.
- [ ! -d "${BASE}/d1" ] && skip "test_51b() not run" && return 0
+ # unlink all but 100 subdirectories, then check it still works
+ local left=100
+ local delete=$((nrdirs - left))
# for ldiskfs the nlink count should be 1, but this is OSD specific
# and so this is listed for informational purposes only
- echo "nlink before: $(stat -c %h $BASE), created before: $NUMTEST"
- unlinkmany -d $BASE/d $DELETE
- RC=$?
-
- if [ $RC -ne 0 ]; then
- if [ "$NUMPREV" == "failed" ]; then
- skip "previous setup failed"
- return 0
- else
- error "unlink of first $DELETE subdirs failed"
- return $RC
- fi
- fi
+ echo "nlink before: $(stat -c %h $dir), created before: $nrdirs"
+ unlinkmany -d $dir/d $delete ||
+ error "unlink of first $delete subdirs failed"
- echo "nlink between: $(stat -c %h $BASE)"
- # trim the first line of ls output
- local FOUND=$(($(ls -l ${BASE} | wc -l) - 1))
- [ $FOUND -ne $LEFT ] &&
- error "can't find subdirs: found only $FOUND/$LEFT"
+ echo "nlink between: $(stat -c %h $dir)"
+ local found=$(ls -U $dir | wc -l)
+ [ $found -ne $left ] &&
+ error "can't find subdirs: found only $found, expected $left"
- unlinkmany -d $BASE/d $DELETE $LEFT ||
- error "unlink of second $LEFT subdirs failed"
+ unlinkmany -d $dir/d $delete $left ||
+ error "unlink of second $left subdirs failed"
# regardless of whether the backing filesystem tracks nlink accurately
# or not, the nlink count shouldn't be more than "." and ".." here
- local AFTER=$(stat -c %h $BASE)
- [[ $AFTER -gt 2 ]] && error "nlink after: $AFTER > 2" ||
- echo "nlink after: $AFTER"
+ local after=$(stat -c %h $dir)
+ [[ $after -gt 2 ]] && error "nlink after: $after > 2" ||
+ echo "nlink after: $after"
}
-run_test 51ba "verify nlink for many subdirectory cleanup"
+run_test 51b "exceed 64k subdirectory nlink limit on create, verify unlink"
test_51d() {
[ $PARALLEL == "yes" ] && skip "skip parallel run" && return
echo "Wrote ${DIFF}KB to smaller OST $MINI1"
DIFF2=$(($MAXV1 - ${AVAIL[$MAXI1]}))
echo "Wrote ${DIFF2}KB to larger OST $MAXI1"
- FILL=$(($DIFF2 * 100 / $DIFF - 100))
- [ $DIFF -gt 0 ] &&
+ if [[ $DIFF -gt 0 ]]; then
+ FILL=$(($DIFF2 * 100 / $DIFF - 100))
echo "Wrote ${FILL}% more data to larger OST $MAXI1"
+ fi
# Figure out which files were written where
UUID=$(lctl get_param -n lov.${FSNAME}-clilov-*.target_obd |
echo $UUID
MAXC=$($GETSTRIPE --ost $UUID $DIR/$tdir | grep $DIR | wc -l)
echo "$MAXC files created on larger OST $MAXI1"
- FILL=$(($MAXC * 100 / $MINC - 100))
- [[ $MINC -gt 0 ]] &&
+ if [[ $MINC -gt 0 ]]; then
+ FILL=$(($MAXC * 100 / $MINC - 100))
echo "Wrote ${FILL}% more files to larger OST $MAXI1"
+ fi
[[ $MAXC -gt $MINC ]] ||
error_ignore LU-9 "stripe QOS didn't balance free space"
simple_cleanup_common
touch ${testdir}/${tfile} || "touch failed"
check_stats $SINGLEMDS "open" 1
check_stats $SINGLEMDS "close" 1
- mknod ${testdir}/${tfile}-pipe p || "mknod failed"
- check_stats $SINGLEMDS "mknod" 1
+ [ $(lustre_version_code $SINGLEMDS) -ge $(version_code 2.8.54) ] && {
+ mknod ${testdir}/${tfile}-pipe p || "mknod failed"
+ check_stats $SINGLEMDS "mknod" 2
+ }
rm -f ${testdir}/${tfile}-pipe || "pipe remove failed"
check_stats $SINGLEMDS "unlink" 1
rm -f ${testdir}/${tfile} || error "file remove failed"
# the work load on the host machine when the task is running.
which virt-what 2> /dev/null && [ "$(virt-what)" != "kvm" ] ||
{ echo "no virt-what installed or running in kvm; ignore error";
- my_error=error_ignore; }
+ my_error="error_ignore env=kvm"; }
# create a large file for fast read verification
dd if=/dev/zero of=$DIR/$tfile bs=128M count=1 > /dev/null 2>&1
}
run_test 248 "fast read verification"
+test_249() { # LU-7890
+ rm -f $DIR/$tfile
+ $SETSTRIPE -c 1 $DIR/$tfile
+
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.8.53) ] &&
+ skip "Need at least version 2.8.54"
+
+ # Offset 2T == 4k * 512M
+ dd if=/dev/zero of=$DIR/$tfile bs=4k count=1 seek=512M ||
+ error "dd to 2T offset failed"
+}
+run_test 249 "Write above 2T file size"
+
test_250() {
[ "$(facet_fstype ost$(($($GETSTRIPE -i $DIR/$tfile) + 1)))" = "zfs" ] \
&& skip "no 16TB file size limit on ZFS" && return
}
run_test 404 "validate manual {de}activated works properly for OSPs"
+test_405() {
+ [ $(lustre_version_code $SINGLEMDS) -lt $(version_code 2.6.92) ] &&
+ skip "Layout swap lock is not supported" && return
+
+ check_swap_layouts_support && return 0
+
+ test_mkdir -p $DIR/$tdir
+ swap_lock_test -d $DIR/$tdir ||
+ error "One layout swap locked test failed"
+}
+run_test 405 "Various layout swap lock tests"
+
#
# tests that do cleanup/setup should be run at the end
#