}
# Create fs of certain size on scratch device
-# _scratch_mkfs_sized <size in bytes> [optional blocksize]
-_scratch_mkfs_sized()
+# _try_scratch_mkfs_sized <size in bytes> [optional blocksize]
+_try_scratch_mkfs_sized()
{
local fssize=$1
local blocksize=$2
esac
}
+_scratch_mkfs_sized()
+{
+ _try_scratch_mkfs_sized $* || _fail "_scratch_mkfs_sized failed with ($*)"
+}
+
# Emulate an N-data-disk stripe w/ various stripe units
# _scratch_mkfs_geom <sunit bytes> <swidth multiplier> [optional blocksize]
_scratch_mkfs_geom()
_scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
- _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
- || _fail "size=$fsz mkfs failed"
+ _scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount
# -w ensures that the only ops are ones which cause write I/O
run_check $FSSTRESS_PROG -d $SCRATCH_MNT -w -p $procs -n 2000 \
_scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
- _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
- || _fail "size=$fsz mkfs failed"
+ _scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount "-o noatime"
run_check $FSSTRESS_PROG -d $SCRATCH_MNT -n $ops $FSSTRESS_AVOID -x \
_scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
- _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
- || _fail "size=$fsz mkfs failed"
+ _scratch_mkfs_sized $fsz >>$seqres.full 2>&1
_scratch_mount "-o noatime"
_btrfs receive $SCRATCH_MNT < $send_files_dir/base.snap
# With 4k block size, this amounts to 10M FS instance.
fssize=$((2560 * $blocksize))
-_scratch_mkfs_sized $fssize >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $fssize >> $seqres.full 2>&1
_require_metadata_journaling $SCRATCH_DEV
offset=0
# Initalize a 512M ext4 fs with resize_inode feature disabled
dev_size=$((512 * 1024 * 1024))
MKFS_OPTIONS="-O ^resize_inode $MKFS_OPTIONS" _scratch_mkfs_sized $dev_size \
- >>$seqres.full 2>&1 || _fail "mkfs failed"
+ >>$seqres.full 2>&1
# Force some reserved GDT blocks to trigger the bug
$DEBUGFS_PROG -w -R "set_super_value s_reserved_gdt_blocks 100" $SCRATCH_DEV \
# btrfs needs at least 256MB (with upward round off) to create a non-mixed mode
# fs. Ref: btrfs-progs: btrfs_min_dev_size()
-_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1 \
- || _fail "mkfs failed"
+_scratch_mkfs_sized $((256 * 1024 * 1024)) >> $seqres.full 2>&1
_scratch_mount
out=$SCRATCH_MNT/fillup.$$
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
fs_size=$((256 * 1024 * 1024))
-_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1
_scratch_mount
mkdir $SCRATCH_MNT/subdir
_scratch_mkfs_xfs -dsize=$fsz,agcount=$ags >>$seqres.full 2>&1 \
|| _fail "size=$fsz,agcount=$ags mkfs failed"
else
- _scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
- || _fail "size=$fsz mkfs failed"
+ _scratch_mkfs_sized $fsz >>$seqres.full 2>&1
fi
_scratch_mount
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
rm -rf $testdir
mkdir $testdir
file_size=$((768 * 1024 * 1024))
fs_size=$((1024 * 1024 * 1024))
-_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $fs_size >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
rm -rf $testdir
mkdir $testdir
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
rm -rf $testdir
mkdir $testdir
if [ $sz_bytes -lt $((32 * 1048576)) ]; then
sz_bytes=$((32 * 1048576))
fi
-_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $sz_bytes >> $seqres.full 2>&1
_scratch_mount >> $seqres.full 2>&1
rm -rf $testdir
mkdir $testdir
_scratch_unmount > /dev/null 2>&1
# Try to format and mount with the given blocksize. If they don't
# succeed, move on to the next block size.
- if ! _scratch_mkfs_sized $devsize $blocksize >> $seqres.full 2>&1 ||
+ if ! _try_scratch_mkfs_sized $devsize $blocksize >> $seqres.full 2>&1 ||
! _try_scratch_mount >> $seqres.full 2>&1 ||
test "$(stat -f -c '%S' $SCRATCH_MNT)" -ne "$blocksize"; then
echo "+++ Format and mount failed" >> $seqres.full
_require_xfs_io_command "finsert"
dev_size=$((80 * 1024 * 1024))
-_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1 || _fail "mkfs failed"
+_scratch_mkfs_sized $dev_size >>$seqres.full 2>&1
_scratch_mount
_require_congruent_file_oplen $SCRATCH_MNT 1048576 # finsert at 1M
_require_fs_space $SCRATCH_MNT 196608
_scratch_unmount
-_scratch_mkfs_sized $((96 * 1024 * 1024)) > $tmp.mkfs.raw || _fail "mkfs failed"
+_scratch_mkfs_sized $((96 * 1024 * 1024)) > $tmp.mkfs.raw
cat $tmp.mkfs.raw | _filter_mkfs >$seqres.full 2>$tmp.mkfs
# get original data blocks number and agcount
. $tmp.mkfs
sdev=$(_short_dev $SCRATCH_DEV)
# use a small log fs
-_scratch_mkfs_sized $((1024 * 1024 * 500)) >> $seqres.full 2>&1 ||
- _fail "mkfs failed"
+_scratch_mkfs_sized $((1024 * 1024 * 500)) >> $seqres.full 2>&1
_scratch_mount
# populate the fs with some data and cycle the mount to reset the log head/tail