Replace every explicit mount/umount of scratch or test devices with
helper functions. This allows the next patch to add in hooks to these
functions in order to set up & tear down overlayfs on every mount/umount
(also adds _test_unmount(), which didn't exist prior)
[Eryu Guan rebased the patch agains latest master and replaced more
mount/umount with helpers]
Signed-off-by: Eryu Guan <eguan@redhat.com>
Signed-off-by: Eric Sandeen <esandeen@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
136 files changed:
if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
echo "RECREATING -- $FSTYP on $TEST_DEV"
if $RECREATE_TEST_DEV || [ "$OLD_FSTYP" != "$FSTYP" ]; then
echo "RECREATING -- $FSTYP on $TEST_DEV"
- umount $TEST_DEV 2> /dev/null
+ _test_unmount 2> /dev/null
if ! _test_mkfs >$tmp.err 2>&1
then
echo "our local _test_mkfs routine ..."
if ! _test_mkfs >$tmp.err 2>&1
then
echo "our local _test_mkfs routine ..."
fi
_prepare_test_list
elif [ "$OLD_MOUNT_OPTIONS" != "$MOUNT_OPTIONS" ]; then
fi
_prepare_test_list
elif [ "$OLD_MOUNT_OPTIONS" != "$MOUNT_OPTIONS" ]; then
- umount $TEST_DEV 2> /dev/null
+ _test_unmount 2> /dev/null
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
if [ $? -ne 1 ]; then
echo $out
out=`_mount_or_remount_rw "$MOUNT_OPTIONS" $TEST_DEV $TEST_DIR`
if [ $? -ne 1 ]; then
echo $out
needwrap=true
if [ ! -z "$SCRATCH_DEV" ]; then
needwrap=true
if [ ! -z "$SCRATCH_DEV" ]; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2> /dev/null
# call the overridden mkfs - make sure the FS is built
# the same as we'll create it later.
# call the overridden mkfs - make sure the FS is built
# the same as we'll create it later.
- umount $TEST_DEV 2> /dev/null
- umount $SCRATCH_DEV 2> /dev/null
+ _test_unmount 2> /dev/null
+ _scratch_unmount 2> /dev/null
{
_scratch_mkfs_xfs > /dev/null 2>&1 \
|| _fail "_scratch_mkfs_xfs failed on $SCRATCH_DEV"
{
_scratch_mkfs_xfs > /dev/null 2>&1 \
|| _fail "_scratch_mkfs_xfs failed on $SCRATCH_DEV"
- _mount -o noattr2 $SCRATCH_DEV > /dev/null 2>&1 \
+ _scratch_mount -o noattr2 > /dev/null 2>&1 \
|| _notrun "noattr2 mount option not supported on $SCRATCH_DEV"
_scratch_unmount
}
|| _notrun "noattr2 mount option not supported on $SCRATCH_DEV"
_scratch_unmount
}
_stable_fs()
{
_saveddir=`pwd`; cd /
_stable_fs()
{
_saveddir=`pwd`; cd /
- umount $SCRATCH_MNT >>$seqres.full || _fail "unmount failed"
+ _scratch_unmount >>$seqres.full || _fail "unmount failed"
_scratch_mount >>$seqres.full || _fail "mount failed"
cd $_saveddir
}
_scratch_mount >>$seqres.full || _fail "mount failed"
cd $_saveddir
}
{
cd /
rm -rf ${SCRATCH_MNT}/stream*
{
cd /
rm -rf ${SCRATCH_MNT}/stream*
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
# unmount the FS
_full "umount"
# unmount the FS
_full "umount"
- umount $SCRATCH_DEV >>$seqres.full 2>&1
+ _scratch_unmount >>$seqres.full 2>&1
if [ $? -ne 0 ] ; then
_echofull "umount failed"
return 1
if [ $? -ne 0 ] ; then
_echofull "umount failed"
return 1
# unmount the FS
_full "umount"
# unmount the FS
_full "umount"
- umount $SCRATCH_DEV >>$seqres.full 2>&1
+ _scratch_unmount >>$seqres.full 2>&1
if [ $? -ne 0 ] ; then
_echofull "umount failed"
return 1
if [ $? -ne 0 ] ; then
_echofull "umount failed"
return 1
# check after unmount to see if it is clean
# i.e. it is not a 6.5.25 buggy version checking kernel
touch $SCRATCH_MNT/file
# check after unmount to see if it is clean
# i.e. it is not a 6.5.25 buggy version checking kernel
touch $SCRATCH_MNT/file
- umount $SCRATCH_DEV >>$seqres.full 2>&1
+ _scratch_unmount >>$seqres.full 2>&1
if _scratch_xfs_logprint -t | tee -a $seqres.full \
| head | grep -q "<DIRTY>"; then
_notrun "kernel does not support v2 logs"
if _scratch_xfs_logprint -t | tee -a $seqres.full \
| head | grep -q "<DIRTY>"; then
_notrun "kernel does not support v2 logs"
local filename=punch_test_file
cd /
local filename=punch_test_file
cd /
- umount $SCRATCH_MNT >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
_scratch_mkfs_xfs -bsize=$blksize >/dev/null 2>&1 \
|| _fail "mkfs failed"
_scratch_mkfs_xfs -bsize=$blksize >/dev/null 2>&1 \
|| _fail "mkfs failed"
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
_scratch_mount || _fail "qmount failed"
chmod ugo+rwx $SCRATCH_MNT
}
_scratch_mount || _fail "qmount failed"
chmod ugo+rwx $SCRATCH_MNT
}
_mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
}
_mount -t $FSTYP $TEST_OPTIONS $TEST_FS_MOUNT_OPTS $SELINUX_MOUNT_OPTIONS $* $TEST_DEV $TEST_DIR
}
+_test_unmount()
+{
+ $UMOUNT_PROG $TEST_DEV
+}
+
$SCRATCH_MNT/.use_space 2>&1 > /dev/null
export NUM_SPACE_FILES=1
status=$?
$SCRATCH_MNT/.use_space 2>&1 > /dev/null
export NUM_SPACE_FILES=1
status=$?
if [ $status -ne 0 ]; then
echo "large file prealloc failed"
cat $tmp_dir/mnt.err >&2
if [ $status -ne 0 ]; then
echo "large file prealloc failed"
cat $tmp_dir/mnt.err >&2
fi
export NUM_SPACE_FILES=$nfiles
fi
export NUM_SPACE_FILES=$nfiles
if [ $status -ne 0 ]; then
echo "large file prealloc failed"
cat $tmp_dir/mnt.err >&2
if [ $status -ne 0 ]; then
echo "large file prealloc failed"
cat $tmp_dir/mnt.err >&2
exit 1
fi
# and then unmount it
exit 1
fi
# and then unmount it
- if ! $UMOUNT_PROG $SCRATCH_DEV
then
echo "failed to unmount $SCRATCH_DEV"
exit 1
then
echo "failed to unmount $SCRATCH_DEV"
exit 1
_scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support crc feature"
_scratch_mkfs_xfs -m crc=1 >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support crc feature"
}
# this test requires the ext4 kernel support crc feature on scratch device
}
# this test requires the ext4 kernel support crc feature on scratch device
dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support metadata_csum feature"
dumpe2fs -h $SCRATCH_DEV 2> /dev/null | grep -q metadata_csum || _notrun "metadata_csum not supported by this filesystem"
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support metadata_csum feature"
}
# this test requires the xfs kernel support crc feature on scratch device
}
# this test requires the xfs kernel support crc feature on scratch device
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support crc feature"
xfs_info $SCRATCH_MNT | grep -q 'crc=1' || _notrun "crc feature not supported by this filesystem"
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support crc feature"
xfs_info $SCRATCH_MNT | grep -q 'crc=1' || _notrun "crc feature not supported by this filesystem"
}
# this test requires the bigalloc feature to be available in mkfs.ext4
}
# this test requires the bigalloc feature to be available in mkfs.ext4
$MKFS_EXT4_PROG -F -O bigalloc $SCRATCH_DEV 512m >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Ext4 kernel doesn't support bigalloc feature"
$MKFS_EXT4_PROG -F -O bigalloc $SCRATCH_DEV 512m >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Ext4 kernel doesn't support bigalloc feature"
}
# this test requires the finobt feature to be available in mkfs.xfs
}
# this test requires the finobt feature to be available in mkfs.xfs
_scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support finobt feature"
_scratch_mkfs_xfs -m crc=1,finobt=1 >/dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support finobt feature"
}
# this test requires xfs sysfs attribute support
}
# this test requires xfs sysfs attribute support
_scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "kernel does not support sparse inodes"
_scratch_mkfs_xfs -m crc=1 -i sparse > /dev/null 2>&1
_scratch_mount >/dev/null 2>&1 \
|| _notrun "kernel does not support sparse inodes"
}
# this test requires that external log/realtime devices are not in use
}
# this test requires that external log/realtime devices are not in use
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support meta_uuid feature"
_scratch_mount >/dev/null 2>&1 \
|| _notrun "Kernel doesn't support meta_uuid feature"
}
_require_btrfs_dev_del_by_devid()
}
_require_btrfs_dev_del_by_devid()
dd if=/bin/bash of=$SCRATCH_MNT/sh 2>&1 |_filter_dd
sync
rm -f $SCRATCH_MNT/sh
dd if=/bin/bash of=$SCRATCH_MNT/sh 2>&1 |_filter_dd
sync
rm -f $SCRATCH_MNT/sh
_zero_position $value "$structure"
_scratch_xfs_repair 2>&1 | _filter_repair
_zero_position $value "$structure"
_scratch_xfs_repair 2>&1 | _filter_repair
POSIXLY_CORRECT=yes \
dd if=$SCRATCH_MNT/sh of=/dev/null 2>&1 |_filter_dd #read
rm -f $SCRATCH_MNT/sh #unlink
POSIXLY_CORRECT=yes \
dd if=$SCRATCH_MNT/sh of=/dev/null 2>&1 |_filter_dd #read
rm -f $SCRATCH_MNT/sh #unlink
- umount $SCRATCH_MNT #umount
+ _scratch_unmount #umount
}
# make sure this script returns success
}
# make sure this script returns success
_cleanup()
{
echo " *** umount"
_cleanup()
{
echo " *** umount"
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_log " *** init"
_log " *** unmounting scratch device"
_log " *** init"
_log " *** unmounting scratch device"
-umount $SCRATCH_DEV 2>&1 | _fix_malloc >>$FULL
+_scratch_unmount 2>&1 | _fix_malloc >>$FULL
_log " *** clean scratch device"
_log " *** clean scratch device"
_log " *** unmounting scratch device"
_log " *** unmounting scratch device"
- umount $SCRATCH_DEV 2>&1 | _logp \
+ _scratch_unmount 2>&1 | _logp \
|| _fail " !!! failed to umount"
let "pass = pass + 1"
|| _fail " !!! failed to umount"
let "pass = pass + 1"
\rm -rf $firstvol/*
_verify_checksum $SNAPNAME $tmp.$tname.sum
\rm -rf $firstvol/*
_verify_checksum $SNAPNAME $tmp.$tname.sum
-umount $SCRATCH_DEV || _fail "unmount failed"
+_scratch_unmount || _fail "unmount failed"
echo "Silence is golden"
status=0; exit
echo "Silence is golden"
status=0; exit
cd /
rm -f $tmp.*
if [ $dev_removed == 1 ]; then
cd /
rm -f $tmp.*
if [ $dev_removed == 1 ]; then
_devmgt_add "${DEVHTL}"
fi
}
_devmgt_add "${DEVHTL}"
fi
}
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
_scratch_mount
dirp=`mktemp -duq $SCRATCH_MNT/dir.XXXXXX`
_populate_fs -n 1 -f 20 -d 10 -r $dirp -s 10
$BTRFS_UTIL_PROG device add ${devs[$i]} $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "device add failed"
done
$BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "balance failed"
$BTRFS_UTIL_PROG device add ${devs[$i]} $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "device add failed"
done
$BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "balance failed"
$BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "dev balance failed"
# cleaup. add the removed disk
$BTRFS_UTIL_PROG filesystem balance $SCRATCH_MNT >> $seqres.full 2>&1 || _fail "dev balance failed"
# cleaup. add the removed disk
_devmgt_add "${DEVHTL}"
dev_removed=0
}
_devmgt_add "${DEVHTL}"
dev_removed=0
}
dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
$BTRFS_UTIL_PROG device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
$BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV 2>&1 | grep $dev_del >> $seqres.full && _fail "btrfs still shows the deleted dev"
dev_del=`echo ${SCRATCH_DEV_POOL} | awk '{print $NF}'`
$BTRFS_UTIL_PROG device delete $dev_del $SCRATCH_MNT || _fail "btrfs device delete failed"
$BTRFS_UTIL_PROG filesystem show $SCRATCH_DEV 2>&1 | grep $dev_del >> $seqres.full && _fail "btrfs still shows the deleted dev"
snap_name=$4
do_bg_noise=$5
snap_name=$4
do_bg_noise=$5
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
$SCRATCH_MNT/$snap_name
_run_btrfs_util_prog subvolume snapshot $SCRATCH_MNT \
$SCRATCH_MNT/$snap_name
- run_check umount $SCRATCH_DEV >/dev/null 2>&1
+ run_check _scratch_unmount >/dev/null 2>&1
run_check _scratch_mount "-o compress=lzo"
# make some noise but ensure we're not touching existing data
run_check _scratch_mount "-o compress=lzo"
# make some noise but ensure we're not touching existing data
# now make more files to get a higher tree
run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
$FSSTRESS_AVOID
# now make more files to get a higher tree
run_check $FSSTRESS_PROG -d $clean_dir -w -p $procs -n 2000 \
$FSSTRESS_AVOID
- run_check umount $SCRATCH_DEV >/dev/null 2>&1
+ run_check _scratch_unmount >/dev/null 2>&1
run_check _scratch_mount "-o atime"
if [ $do_bg_noise -ne 0 ]; then
run_check _scratch_mount "-o atime"
if [ $do_bg_noise -ne 0 ]; then
- umount $SCRATCH_MNT > /dev/null 2>&1
+ _scratch_unmount > /dev/null 2>&1
- umount $SCRATCH_MNT > /dev/null 2>&1
+ _scratch_unmount > /dev/null 2>&1
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
_create_file $1
_scratch_mkfs > /dev/null 2>&1
_scratch_mount
_create_file $1
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
run_check $FSSUM_PROG -A -f -w $tmp/incr.fssum -x $SCRATCH_MNT/incr/base \
$SCRATCH_MNT/incr
run_check $FSSUM_PROG -A -f -w $tmp/incr.fssum -x $SCRATCH_MNT/incr/base \
$SCRATCH_MNT/incr
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
echo "*** mkfs -dsize=$fsz" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_sized $fsz >>$seqres.full 2>&1 \
sync; sync
btrfs_replace_test $source_dev $target_dev "" $with_cancel $quick
sync; sync
btrfs_replace_test $source_dev $target_dev "" $with_cancel $quick
- umount $SCRATCH_MNT > /dev/null 2>&1
+ _scratch_unmount > /dev/null 2>&1
if echo $mkfs_options | egrep -qv "raid1|raid5|raid6|raid10" || \
[ "${with_cancel}Q" = "cancelQ" ]; then
if echo $mkfs_options | egrep -qv "raid1|raid5|raid6|raid10" || \
[ "${with_cancel}Q" = "cancelQ" ]; then
fi
btrfs_replace_test $source_dev $target_dev "-r" $with_cancel $quick
fi
btrfs_replace_test $source_dev $target_dev "-r" $with_cancel $quick
- umount $SCRATCH_MNT > /dev/null 2>&1
+ _scratch_unmount > /dev/null 2>&1
# because in /proc/mounts the 2nd device of the filesystem is
# shown after the replace operation. Let's just do the mount
# test manually after _check_btrfs_filesystem is finished.
# because in /proc/mounts the 2nd device of the filesystem is
# shown after the replace operation. Let's just do the mount
# test manually after _check_btrfs_filesystem is finished.
- umount $SCRATCH_MNT > /dev/null 2>&1
+ _scratch_unmount > /dev/null 2>&1
if [ "${with_cancel}Q" != "cancelQ" ]; then
# after the replace operation, use the target_dev for everything
_check_btrfs_filesystem $target_dev
if [ "${with_cancel}Q" != "cancelQ" ]; then
# after the replace operation, use the target_dev for everything
_check_btrfs_filesystem $target_dev
- umount $SCRATCH_MNT &>/dev/null
+ _scratch_unmount &>/dev/null
echo "test reflinks across different mountpoints of same device"
mount $TEST_DEV $SCRATCH_MNT || _fail "Couldn't double-mount $TEST_DEV"
_create_reflinks_to $DUAL_MOUNT_DIR
echo "test reflinks across different mountpoints of same device"
mount $TEST_DEV $SCRATCH_MNT || _fail "Couldn't double-mount $TEST_DEV"
_create_reflinks_to $DUAL_MOUNT_DIR
# success, all done
status=0
# success, all done
status=0
rm -rf $TESTDIR1
rm -rf $TESTDIR2
$BTRFS_UTIL_PROG subvolume delete $SUBVOL1 >> $seqres.full
rm -rf $TESTDIR1
rm -rf $TESTDIR2
$BTRFS_UTIL_PROG subvolume delete $SUBVOL1 >> $seqres.full
bit_set=1
# Unmount the ${TEST_DEV}
bit_set=1
# Unmount the ${TEST_DEV}
# Run debugfs to gather file_parameters - specifically iflags.
file_params=`debugfs ${TEST_DEV} -R "stat ${1}" 2>&1 | grep -e Flags:`
# Run debugfs to gather file_parameters - specifically iflags.
file_params=`debugfs ${TEST_DEV} -R "stat ${1}" 2>&1 | grep -e Flags:`
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
# 30 loops is enough to crash a buggy kernel
i=0
while [ $i -lt 30 ]; do
# 30 loops is enough to crash a buggy kernel
i=0
while [ $i -lt 30 ]; do
- mount $SCRATCH_DEV $SCRATCH_MNT
- umount $SCRATCH_DEV
+ _scratch_mount
+ _scratch_unmount
# by limiting the amount of preallocation and therefore the amount of blocks
# zeroed during the truncfile test run.
if [ "$FSTYP" == "xfs" ]; then
# by limiting the amount of preallocation and therefore the amount of blocks
# zeroed during the truncfile test run.
if [ "$FSTYP" == "xfs" ]; then
_test_mount -o allocsize=64k
fi
_test_mount -o allocsize=64k
fi
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
wait $fio_pid
# We expect that broken FS still can be umounted
wait $fio_pid
# We expect that broken FS still can be umounted
- run_check umount $SCRATCH_DEV
+ run_check _scratch_unmount
# Once filesystem was umounted no one is able to write to block device
# It is now safe to bring device back to normal state
stop_fail_scratch_dev
# Once filesystem was umounted no one is able to write to block device
# It is now safe to bring device back to normal state
stop_fail_scratch_dev
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
# shutdown immediately after, then remount and test
src/godown $SCRATCH_MNT
# shutdown immediately after, then remount and test
src/godown $SCRATCH_MNT
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
# sync, then shutdown immediately after, then remount and test
sync
src/godown $SCRATCH_MNT
# sync, then shutdown immediately after, then remount and test
sync
src/godown $SCRATCH_MNT
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
# sync, then shutdown immediately after, then remount and test
sync
src/godown $SCRATCH_MNT
# sync, then shutdown immediately after, then remount and test
sync
src/godown $SCRATCH_MNT
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
if [ ! _check_scratch_fs ]
then
echo error detected in filesystem
# http://oss.sgi.com/bugzilla/show_bug.cgi?id=807
#
echo "unmounting read-only filesystem"
# http://oss.sgi.com/bugzilla/show_bug.cgi?id=807
#
echo "unmounting read-only filesystem"
-umount $SCRATCH_MNT 2>&1 | _filter_scratch
+_scratch_unmount 2>&1 | _filter_scratch
echo "setting device read-write"
blockdev --setrw $SCRATCH_DEV
echo "setting device read-write"
blockdev --setrw $SCRATCH_DEV
src/godown -f $SCRATCH_MNT
echo "unmounting shutdown filesystem:"
src/godown -f $SCRATCH_MNT
echo "unmounting shutdown filesystem:"
-umount $SCRATCH_MNT 2>&1 | _filter_scratch
+_scratch_unmount 2>&1 | _filter_scratch
echo "setting device read-only"
blockdev --setro $SCRATCH_DEV
echo "setting device read-only"
blockdev --setro $SCRATCH_DEV
_scratch_mount 2>&1 | _filter_scratch | _filter_ro_mount
echo "unmounting read-only filesystem"
_scratch_mount 2>&1 | _filter_scratch | _filter_ro_mount
echo "unmounting read-only filesystem"
-umount $SCRATCH_MNT 2>&1 | _filter_scratch
+_scratch_unmount 2>&1 | _filter_scratch
#
# This is the way out if the underlying device really is read-only.
#
# This is the way out if the underlying device really is read-only.
_scratch_mount -o norecovery 2>&1 | _filter_scratch | _filter_ro_mount
echo "unmounting read-only filesystem"
_scratch_mount -o norecovery 2>&1 | _filter_scratch | _filter_ro_mount
echo "unmounting read-only filesystem"
-umount $SCRATCH_MNT 2>&1 | _filter_scratch
+_scratch_unmount 2>&1 | _filter_scratch
echo "setting device read-write"
blockdev --setrw $SCRATCH_DEV
echo "setting device read-write"
blockdev --setrw $SCRATCH_DEV
mount: SCRATCH_DEV is write-protected, mounting read-only
mount: cannot mount SCRATCH_DEV read-only
unmounting read-only filesystem
mount: SCRATCH_DEV is write-protected, mounting read-only
mount: cannot mount SCRATCH_DEV read-only
unmounting read-only filesystem
-umount: SCRATCH_MNT: not mounted
+umount: SCRATCH_DEV: not mounted
mounting filesystem with -o norecovery on a read-only device:
mount: SCRATCH_DEV is write-protected, mounting read-only
unmounting read-only filesystem
mounting filesystem with -o norecovery on a read-only device:
mount: SCRATCH_DEV is write-protected, mounting read-only
unmounting read-only filesystem
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
killall -q $FSSTRESS_PROG
wait
sync
killall -q $FSSTRESS_PROG
wait
sync
# now mount again, run the load again, this time with a shutdown.
_scratch_mount
# now mount again, run the load again, this time with a shutdown.
_scratch_mount
# for some reason fsstress processes manage to live on beyond the wait?
sleep 5
# for some reason fsstress processes manage to live on beyond the wait?
sleep 5
# now recover, check the filesystem for consistency
_scratch_mount
# now recover, check the filesystem for consistency
_scratch_mount
_check_scratch_fs
# now clean up.
_check_scratch_fs
# now clean up.
rm -rf $d > /dev/null 2>&1 &
done
wait
rm -rf $d > /dev/null 2>&1 &
done
wait
echo "No output is good. Failures are loud."
echo "No output is good. Failures are loud."
src/godown -v -f $SCRATCH_MNT >> $seqres.full
echo "unmount"
src/godown -v -f $SCRATCH_MNT >> $seqres.full
echo "unmount"
echo "logprint after going down..."
_print_logstate
echo "logprint after going down..."
_print_logstate
ls $SCRATCH_MNT
echo "unmount"
ls $SCRATCH_MNT
echo "unmount"
echo "logprint after mount and replay..."
_print_logstate
echo "logprint after mount and replay..."
_print_logstate
echo "acls before repair:"
list_acls
echo "acls before repair:"
list_acls
-_do 'unmount $SCRATCH_DEV' 'umount $SCRATCH_DEV'
+_do 'unmount $SCRATCH_DEV' '_scratch_unmount'
_do 'repair filesystem' '_check_scratch_fs'
_do 'mount filesytem' '_scratch_mount'
echo "acls after repair: "
_do 'repair filesystem' '_check_scratch_fs'
_do 'mount filesytem' '_scratch_mount'
echo "acls after repair: "
_require_logstate
echo "*** init FS"
_require_logstate
echo "*** init FS"
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
_get_log_configs > $tmp.seq.params
_get_log_configs > $tmp.seq.params
src/godown -v -f $SCRATCH_MNT >> $seqres.full
_echofull "unmount"
src/godown -v -f $SCRATCH_MNT >> $seqres.full
_echofull "unmount"
- umount $SCRATCH_DEV >>$seqres.full 2>&1 \
+ _scratch_unmount >>$seqres.full 2>&1 \
|| _fail "umount failed"
_echofull "logprint after going down..."
|| _fail "umount failed"
_echofull "logprint after going down..."
ls $SCRATCH_MNT
_echofull "unmount"
ls $SCRATCH_MNT
_echofull "unmount"
_echofull "logprint after mount and replay..."
_print_logstate
_echofull "logprint after mount and replay..."
_print_logstate
QUOTA_OPTION=`_get_quota_option`
echo "*** init FS"
QUOTA_OPTION=`_get_quota_option`
echo "*** init FS"
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
_get_log_configs > $tmp.seq.params
_get_log_configs > $tmp.seq.params
src/godown -v -f $SCRATCH_MNT >> $seqres.full
_echofull "unmount"
src/godown -v -f $SCRATCH_MNT >> $seqres.full
_echofull "unmount"
- umount $SCRATCH_DEV >>$seqres.full 2>&1 \
+ _scratch_unmount >>$seqres.full 2>&1 \
|| _fail "umount failed"
_echofull "logprint after going down..."
|| _fail "umount failed"
_echofull "logprint after going down..."
diff -us $tmp.ls1 $tmp.ls2 | sed "s#$tmp#TMP#g"
_echofull "unmount"
diff -us $tmp.ls1 $tmp.ls2 | sed "s#$tmp#TMP#g"
_echofull "unmount"
_echofull "logprint after mount and replay..."
_print_logstate
_echofull "logprint after mount and replay..."
_print_logstate
{
cd /
echo; echo "*** unmount"
{
cd /
echo; echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
ln -s $SCRATCH_MNT/testdir $symlink
$UMOUNT_PROG -l $symlink >>$seqres.full 2>&1
ln -s $SCRATCH_MNT/testdir $symlink
$UMOUNT_PROG -l $symlink >>$seqres.full 2>&1
- # umount $SCRATCH_MNT should not be blocked
+ # _scratch_unmount should not be blocked
_scratch_unmount 2>&1 | tee -a $seqres.full
}
_scratch_unmount 2>&1 | tee -a $seqres.full
}
echo "*** init FS"
rm -f $seqres.full
echo "*** init FS"
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
_require_scratch
rm -f $seqres.full
_require_scratch
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** mkfs"
_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
echo "*** mkfs"
_scratch_mkfs >/dev/null 2>&1 || _fail "mkfs failed"
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
_lets_get_pidst
}
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
_lets_get_pidst
}
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
echo "*** init fs"
rm -f $seqres.full
echo "*** init fs"
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
{
cd /
echo "*** unmount"
{
cd /
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
}
trap "_cleanup; rm -f $tmp.*; exit \$status" 0 1 2 3 15
echo "*** create filesystem"
rm -f $seqres.full
echo "*** create filesystem"
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
SIZE=`expr 50 \* 1024 \* 1024`
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
SIZE=`expr 50 \* 1024 \* 1024`
cd /
echo "*** cleaning up"
$timmutable -r $SCRATCH_MNT/$seq
cd /
echo "*** cleaning up"
$timmutable -r $SCRATCH_MNT/$seq
}
# get standard environment, filters and checks
}
# get standard environment, filters and checks
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
echo "*** mkfs -dsize=$fsz,agcount=$ags" >>$seqres.full
echo "" >>$seqres.full
if [ $FSTYP = xfs ]
echo "*** mkfs -dsize=$fsz,agcount=$ags" >>$seqres.full
echo "" >>$seqres.full
if [ $FSTYP = xfs ]
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
_require_attrs
rm -f $seqres.full
_require_attrs
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 \
echo
echo Checking filesystem
echo
echo Checking filesystem
echo "asdf" >> $SCRATCH_MNT/testfile2
_compare_access_times $SCRATCH_MNT/testfile2 "writing file"
echo "asdf" >> $SCRATCH_MNT/testfile2
_compare_access_times $SCRATCH_MNT/testfile2 "writing file"
# success, all done
status=0
# success, all done
status=0
if [ $? -eq 0 ] ; then
echo "Error: we shouldn't be able to ls the directory"
fi
if [ $? -eq 0 ] ; then
echo "Error: we shouldn't be able to ls the directory"
fi
CWD=`pwd`
cd /
# pipe error into /dev/null, in case not mounted (after _require_scratch)
CWD=`pwd`
cd /
# pipe error into /dev/null, in case not mounted (after _require_scratch)
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
_scratch_mount
cd "$CWD"
}
_scratch_mount
cd "$CWD"
}
_reflink_range "$TESTDIR2/file1" 0 "$TESTDIR2/file2" 0 $BLKSZ >> "$seqres.full"
echo "Check scratch fs"
_reflink_range "$TESTDIR2/file1" 0 "$TESTDIR2/file2" 0 $BLKSZ >> "$seqres.full"
echo "Check scratch fs"
_check_scratch_fs
# success, all done
_check_scratch_fs
# success, all done
_dedupe_range "$TESTDIR2/file1" 0 "$TESTDIR2/file2" 0 $BLKSZ >> "$seqres.full"
echo "Check scratch fs"
_dedupe_range "$TESTDIR2/file1" 0 "$TESTDIR2/file2" 0 $BLKSZ >> "$seqres.full"
echo "Check scratch fs"
_check_scratch_fs
# success, all done
_check_scratch_fs
# success, all done
wait
echo "Check for damage"
wait
echo "Check for damage"
_check_scratch_fs
echo "Done"
_check_scratch_fs
echo "Done"
wait
echo "Check for damage"
wait
echo "Check for damage"
_check_scratch_fs
echo "Done"
_check_scratch_fs
echo "Done"
| _show_wrote_and_stat_only
echo "# unmounting scratch"
| _show_wrote_and_stat_only
echo "# unmounting scratch"
-umount $SCRATCH_MNT>>$seqres.full 2>&1 \
+_scratch_unmount>>$seqres.full 2>&1 \
|| _fail "unmount failed"
echo "# mounting scratch"
|| _fail "unmount failed"
echo "# mounting scratch"
| _show_wrote_and_stat_only
echo "# unmounting scratch"
| _show_wrote_and_stat_only
echo "# unmounting scratch"
-umount $SCRATCH_MNT>>$seqres.full 2>&1 \
+_scratch_unmount>>$seqres.full 2>&1 \
|| _fail "unmount failed"
echo "# mounting scratch"
|| _fail "unmount failed"
echo "# mounting scratch"
time2=`_access_time $testfile | tee -a $seqres.full`
cd /
time2=`_access_time $testfile | tee -a $seqres.full`
cd /
_test_mount
time3=`_access_time $testfile | tee -a $seqres.full`
_test_mount
time3=`_access_time $testfile | tee -a $seqres.full`
# real QA test starts here
rm -f $seqres.full
# real QA test starts here
rm -f $seqres.full
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount "-o usrquota,grpquota"
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
quotaon $SCRATCH_MNT 2>/dev/null
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount "-o usrquota,grpquota"
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
quotaon $SCRATCH_MNT 2>/dev/null
echo; echo "### test user accounting"
export MOUNT_OPTIONS="-o usrquota"
echo; echo "### test user accounting"
export MOUNT_OPTIONS="-o usrquota"
type=u
test_files
test_accounting
type=u
test_files
test_accounting
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
echo; echo "### test group accounting"
export MOUNT_OPTIONS="-o grpquota"
echo; echo "### test group accounting"
export MOUNT_OPTIONS="-o grpquota"
type=g
test_files
test_accounting
type=g
test_files
test_accounting
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
# real QA test starts here
rm -f $seqres.full
# real QA test starts here
rm -f $seqres.full
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
echo "--> mkfs 256m filesystem"
_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1
_scratch_mount
echo "--> mkfs 256m filesystem"
_scratch_mkfs_sized `expr 256 \* 1024 \* 1024` >> $seqres.full 2>&1
_scratch_mount
_scratch_mount
echo "--> $loops direct 64m writes in a loop"
_scratch_mount
echo "--> $loops direct 64m writes in a loop"
setquota -u -t $grace $grace $SCRATCH_MNT
setquota -g $qa_user 1000 2000 3 5 $SCRATCH_MNT
setquota -g -t $grace $grace $SCRATCH_MNT
setquota -u -t $grace $grace $SCRATCH_MNT
setquota -g $qa_user 1000 2000 3 5 $SCRATCH_MNT
setquota -g -t $grace $grace $SCRATCH_MNT
echo; echo "### test user limit enforcement"
_scratch_mount "-o usrquota"
echo; echo "### test user limit enforcement"
_scratch_mount "-o usrquota"
test_files
test_enforcement
cleanup_files
test_files
test_enforcement
cleanup_files
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
echo; echo "### test group limit enforcement"
_scratch_mount "-o grpquota"
echo; echo "### test group limit enforcement"
_scratch_mount "-o grpquota"
test_files
test_enforcement
cleanup_files
test_files
test_enforcement
cleanup_files
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
quotaon -u -g $SCRATCH_MNT 2>/dev/null
if ! _fsx 1; then
quotaon -u -g $SCRATCH_MNT 2>/dev/null
if ! _fsx 1; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _check_quota_usage; then
status=1
exit
fi
if ! _check_quota_usage; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _fsx 4; then
status=1
exit
fi
if ! _fsx 4; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _check_quota_usage; then
status=1
exit
fi
if ! _check_quota_usage; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
#flush cache after write
FSX_ARGS="-f $FSX_ARGS"
if ! _fsx 1; then
#flush cache after write
FSX_ARGS="-f $FSX_ARGS"
if ! _fsx 1; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
status=1
exit
fi
if ! _check_quota_usage; then
status=1
exit
fi
if ! _check_quota_usage; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
quotaon -u -g $SCRATCH_MNT 2>/dev/null
if ! _fsstress; then
quotaon -u -g $SCRATCH_MNT 2>/dev/null
if ! _fsstress; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
exit
fi
if ! _check_quota_usage; then
exit
fi
if ! _check_quota_usage; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null
if ! _fsstress; then
setquota -u $qa_user 32000 32000 1000 1000 $SCRATCH_MNT 2>/dev/null
if ! _fsstress; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
exit
fi
if ! _check_quota_usage; then
exit
fi
if ! _check_quota_usage; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
quotaon -u -g $SCRATCH_MNT 2>/dev/null
test_setting
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
quotaon -u -g $SCRATCH_MNT 2>/dev/null
test_setting
# https://bugzilla.redhat.com/show_bug.cgi?id=563267
#
# then you need a more recent mount binary.
# https://bugzilla.redhat.com/show_bug.cgi?id=563267
#
# then you need a more recent mount binary.
-mount -o remount,ro $SCRATCH_DEV 2>&1 | tee -a $seqres.full | _filter_scratch
+_scratch_mount "-o remount,ro" 2>&1 | tee -a $seqres.full | _filter_scratch
touch $SCRATCH_MNT/failed 2>&1 | tee -a $seqres.full | _filter_scratch
touch $SCRATCH_MNT/failed 2>&1 | tee -a $seqres.full | _filter_scratch
-mount -o remount,rw $SCRATCH_DEV 2>&1 | tee -a $seqres.full | _filter_scratch
+_scratch_mount "-o remount,rw" 2>&1 | tee -a $seqres.full | _filter_scratch
$XFS_IO_PROG -c 'pwrite 0 8k' -c 'fsync' \
$SCRATCH_MNT/testfile >>$seqres.full 2>&1
repquota -u -g $SCRATCH_MNT | grep -v "^root" | _filter_scratch
$XFS_IO_PROG -c 'pwrite 0 8k' -c 'fsync' \
$SCRATCH_MNT/testfile >>$seqres.full 2>&1
repquota -u -g $SCRATCH_MNT | grep -v "^root" | _filter_scratch
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
}
# Make a small file system to fill
}
# Make a small file system to fill
-umount $SCRATCH_DEV &> /dev/null
+_scratch_unmount &> /dev/null
_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null
_scratch_mount
# Test must be able to write files with non-root permissions
_scratch_mkfs_sized $(( 1536 * 1024 * 1024 )) &> /dev/null
_scratch_mount
# Test must be able to write files with non-root permissions
# unmount, remount, and check the timestamp
echo "Remounting to flush cache"
# unmount, remount, and check the timestamp
echo "Remounting to flush cache"
_test_mount
# Should yield -315593940 (prior to epoch)
_test_mount
# Should yield -315593940 (prior to epoch)
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1
_scratch_mount
_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1
_scratch_mount
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1
_scratch_mount
_scratch_mkfs_sized $((2 * 1024 * 1024 * 1024)) >>$seqres.full 2>&1
_scratch_mount
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount "-o usrquota,grpquota"
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
_scratch_mkfs >> $seqres.full 2>&1
_scratch_mount "-o usrquota,grpquota"
quotacheck -u -g $SCRATCH_MNT 2>/dev/null
sleep 1
xfs_freeze -u $SCRATCH_MNT
wait $pid
sleep 1
xfs_freeze -u $SCRATCH_MNT
wait $pid
# Failure comes in the form of a deadlock.
# Failure comes in the form of a deadlock.
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_scratch_mount
if ! _workout; then
_scratch_mount
if ! _workout; then
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
src/nsexec -s -U -M "0 $qa_user_id 1000" -G "0 $qa_user_id 1000" src/lstat64 $file |head -3 |_filter_output
}
src/nsexec -s -U -M "0 $qa_user_id 1000" -G "0 $qa_user_id 1000" src/lstat64 $file |head -3 |_filter_output
}
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
echo "*** Remounting ***"
echo ""
sync
echo "*** Remounting ***"
echo ""
sync
-umount $SCRATCH_MNT >>$seqres.full 2>&1
+_scratch_unmount >>$seqres.full 2>&1
_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed"
_print_numeric_uid
_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed"
_print_numeric_uid
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
$nsexec -U -M "0 $acl1 1000" -G "0 $acl1 1000" getfacl --absolute-names -n $file 2>/dev/null | _filter_scratch | _getfacl_filter_nsid
}
$nsexec -U -M "0 $acl1 1000" -G "0 $acl1 1000" getfacl --absolute-names -n $file 2>/dev/null | _filter_scratch | _getfacl_filter_nsid
}
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs >>$seqres.full 2>&1 || _fail "mkfs failed"
echo "*** Remounting ***"
echo ""
sync
echo "*** Remounting ***"
echo ""
sync
-umount $SCRATCH_MNT >>$seqres.full 2>&1
+_scratch_unmount >>$seqres.full 2>&1
_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed"
_print_getfacls
_scratch_mount >>$seqres.full 2>&1 || _fail "mount failed"
_print_getfacls
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
_scratch_mount "-o minixdf"
MINIX_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
_scratch_mount "-o minixdf"
MINIX_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
_scratch_mount "-o bsddf"
BSD_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
_scratch_mount "-o bsddf"
BSD_F_BLOCKS=`stat -f $SCRATCH_MNT | awk '/^Blocks/{print $3}'`
# Echo data to $seqres.full for analysis
echo "Overhead is $OVERHEAD blocks out of $TOTAL_BLOCKS ($FREE_BLOCKS free)" >> $seqres.full
# Echo data to $seqres.full for analysis
echo "Overhead is $OVERHEAD blocks out of $TOTAL_BLOCKS ($FREE_BLOCKS free)" >> $seqres.full
_umount_check_mount()
{
cd /
_umount_check_mount()
{
cd /
udf_db -f $SCRATCH_DEV | _db_filter
udf_db -f $SCRATCH_DEV | _db_filter
${ATTR_PROG} -R -l foo
cd /
${ATTR_PROG} -R -l foo
cd /
udf_db -f $SCRATCH_DEV | _db_filter
udf_db -f $SCRATCH_DEV | _db_filter
udf_db -f $SCRATCH_DEV | _db_filter
udf_db -f $SCRATCH_DEV | _db_filter
_require_scratch
_setup_udf_scratchdir
_require_scratch
_setup_udf_scratchdir
# Inspect the space bitmap
echo bitmap | udf_db -c - $SCRATCH_DEV
# Inspect the space bitmap
echo bitmap | udf_db -c - $SCRATCH_DEV
rm -f $tmp.*
exit $status
}
rm -f $tmp.*
exit $status
}
dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 &
wait
dd if=/dev/zero of=$SCRATCH_MNT/goo count=400 bs=4096 >/dev/null 2>&1 &
dd if=/dev/zero of=$SCRATCH_MNT/moo count=800 bs=4096 >/dev/null 2>&1 &
wait
- umount $SCRATCH_MNT # flush everything
+ _scratch_unmount # flush everything
_scratch_mount # and then remount
}
_scratch_mount # and then remount
}
mkdir $SCRATCH_MNT/x
$here/src/dirhash_collide -d -n 10000 $SCRATCH_MNT/x
mkdir $SCRATCH_MNT/x
$here/src/dirhash_collide -d -n 10000 $SCRATCH_MNT/x
-umount $SCRATCH_MNT 2>&1 | _filter_scratch
+_scratch_unmount 2>&1 | _filter_scratch
_scratch_xfs_repair 2>&1 | _filter_repair
_scratch_xfs_repair 2>&1 | _filter_repair
off_opts=$3
echo "*** umount"
off_opts=$3
echo "*** umount"
QINO_1=`xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | \
grep $qino_1 | awk '{print $NF}'`
QINO_1=`xfs_db -c "sb 0" -c "p" $SCRATCH_DEV | \
grep $qino_1 | awk '{print $NF}'`
xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
echo "*** umount"
xfs_quota -x -c "off -$off_opts" $SCRATCH_MNT
xfs_quota -x -c "remove -$off_opts" $SCRATCH_MNT
echo "*** umount"
echo "*** Usage after quotarm ***"
xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
echo "*** Usage after quotarm ***"
xfs_db -c "inode $QINO_1" -c "p core.nblocks" $SCRATCH_DEV
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
# sparsely populate the fs such that we create records with free inodes
_scratch_mount
_sparse_inode_populate $SCRATCH_MNT 999
# sparsely populate the fs such that we create records with free inodes
_scratch_mount
_sparse_inode_populate $SCRATCH_MNT 999
# corrupt some finobt records
_corrupt_finobt_records $SCRATCH_DEV
# corrupt some finobt records
_corrupt_finobt_records $SCRATCH_DEV
killall -9 fsstress 2>/dev/null
wait
cd /
killall -9 fsstress 2>/dev/null
wait
cd /
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
killall $FSSTRESS_PROG
wait
killall $FSSTRESS_PROG
wait
killall -9 fsstress 2>/dev/null
wait
cd /
killall -9 fsstress 2>/dev/null
wait
cd /
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -rf $SCRATCH_MNT/fsstress
rm -rf $SCRATCH_MNT/dir*
rm -rf $SCRATCH_MNT/fsstress
rm -rf $SCRATCH_MNT/dir*
{
cd /
umount $LOOP_MNT 2>/dev/null
{
cd /
umount $LOOP_MNT 2>/dev/null
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime
echo $orig_sp_time > /proc/sys/fs/xfs/speculative_prealloc_lifetime
cd /
rm -f $tmp.*
echo "*** unmount"
cd /
rm -f $tmp.*
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
- if ! umount $SCRATCH_DEV
then
echo "failed to unmount $SCRATCH_DEV"
exit 1
then
echo "failed to unmount $SCRATCH_DEV"
exit 1
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
# get standard environment, filters and checks
}
# get standard environment, filters and checks
echo "*** init FS"
rm -f $seqres.full
echo "*** init FS"
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_xfs >>$seqres.full 2>&1 \
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_xfs >>$seqres.full 2>&1 \
cd /
_cleanup_logfiles
rm -f $tmp.*
cd /
_cleanup_logfiles
rm -f $tmp.*
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_link_out_file_named $seqfull.op $(_get_os_name)
echo "*** init FS"
_link_out_file_named $seqfull.op $(_get_os_name)
echo "*** init FS"
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
VERSION="-n version=$1"
rm -f $seqfull
VERSION="-n version=$1"
rm -f $seqfull
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
_full "mkfs"
_scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \
_full "mkfs"
_scratch_mkfs_xfs $VERSION -p $protofile >>$seqfull 2>&1 \
echo "*** unmount FS"
_full "umount"
echo "*** unmount FS"
_full "umount"
- umount $SCRATCH_DEV >>$seqfull 2>&1 \
+ _scratch_unmount >>$seqfull 2>&1 \
|| _fail "umount failed"
}
|| _fail "umount failed"
}
_cleanup()
{
echo "*** unmount"
_cleanup()
{
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_require_attrs
rm -f $seqres.full
_require_attrs
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** mkfs"
_scratch_mkfs_xfs >/dev/null \
echo "*** mkfs"
_scratch_mkfs_xfs >/dev/null \
inum_2=`ls -li $testfile.2 | $AWK_PROG '{ print $1 }'`
echo "*** unmount FS"
inum_2=`ls -li $testfile.2 | $AWK_PROG '{ print $1 }'`
echo "*** unmount FS"
-umount $SCRATCH_DEV >>$seqres.full 2>&1 \
+_scratch_unmount >>$seqres.full 2>&1 \
|| _fail "umount failed"
echo "*** dump attributes (1)"
|| _fail "umount failed"
echo "*** dump attributes (1)"
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_notrun "GQuota are enabled, test needs controlled sb recovery"
src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
_notrun "GQuota are enabled, test needs controlled sb recovery"
src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
fi
clear=""
eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
fi
clear=""
eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | perl -ne '
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_notrun "GQuota are enabled, test needs controlled sb recovery"
src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
_notrun "GQuota are enabled, test needs controlled sb recovery"
src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
# rootino, rbmino, and rsumino are now set (lets blow em away!)
_check_root_inos 0
# rootino, rbmino, and rsumino are now set (lets blow em away!)
_check_root_inos 0
cd /
rm -f $tmp.*
echo "*** unmount"
cd /
rm -f $tmp.*
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
echo "*** init FS"
rm -f $seqres.full
echo "*** init FS"
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_xfs >>$seqres.full 2>&1 \
echo "*** MKFS ***" >>$seqres.full
echo "" >>$seqres.full
_scratch_mkfs_xfs >>$seqres.full 2>&1 \
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
_require_scratch
_require_no_large_scratch_dev
_require_scratch
_require_no_large_scratch_dev
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_fill $SCRATCH_MNT/fill_$size
_do "Grow filesystem to ${size}m" "xfs_growfs -D $grow_size $SCRATCH_MNT"
echo -n "Flush filesystem... "
_fill $SCRATCH_MNT/fill_$size
_do "Grow filesystem to ${size}m" "xfs_growfs -D $grow_size $SCRATCH_MNT"
echo -n "Flush filesystem... "
- _do "umount $SCRATCH_MNT"
_do "_scratch_mount"
echo "done"
echo -n "Check files... "
_do "_scratch_mount"
echo "done"
echo -n "Check files... "
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup ; exit \$status" 0 1 2 3 15
_do "xfs_bmap -vp $SCRATCH_MNT/fill"
echo "done"
# flush the filesystem - make sure there is no space "lost" to pre-allocation
_do "xfs_bmap -vp $SCRATCH_MNT/fill"
echo "done"
# flush the filesystem - make sure there is no space "lost" to pre-allocation
-_do "umount $SCRATCH_MNT"
_do "_scratch_mount"
echo -n "Use up any further available space... "
_do "$XFS_IO_PROG -f -c \"falloc 0 1m\" $SCRATCH_MNT/pad"
_do "_scratch_mount"
echo -n "Use up any further available space... "
_do "$XFS_IO_PROG -f -c \"falloc 0 1m\" $SCRATCH_MNT/pad"
- if ! umount $SCRATCH_DEV
then
echo " !!! umount failed (expecting success)"
status=1
then
echo " !!! umount failed (expecting success)"
status=1
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
cat $tmp.quota >> $seqres.full
[ ! -s $tmp.quota ] && echo "warning: quota output file is empty"
cat $tmp.quota >> $seqres.full
[ ! -s $tmp.quota ] && echo "warning: quota output file is empty"
# note - does (insitu) conversion from fs blocks to 1K blocks
xfs_db -rc "dquot -$type $id" -c p $SCRATCH_DEV | tee -a $seqres.full | perl -ne '
# note - does (insitu) conversion from fs blocks to 1K blocks
xfs_db -rc "dquot -$type $id" -c p $SCRATCH_DEV | tee -a $seqres.full | perl -ne '
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
echo
src/lstat64 $SCRATCH_MNT/testfile | _filter_stat
echo
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
_scratch_mkfs_xfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
}
_scratch_mkfs_xfs >> $seqres.full 2>&1 || _fail "mkfs failed!"
else
_notrun "No quota support at mount time"
fi
else
_notrun "No quota support at mount time"
fi
-umount $SCRATCH_MNT 2>/dev/null
+_scratch_unmount 2>/dev/null
_qmount_option "rw" # no quota options
echo "*** Default mount options"
_qmount_option "rw" # no quota options
echo "*** Default mount options"
# too much hassle to get output matching with quotas turned on
# so don't run it
#
# too much hassle to get output matching with quotas turned on
# so don't run it
#
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mount
$here/src/feature -U $SCRATCH_DEV && \
_notrun "UQuota enabled, test needs controlled xfsdump output"
_scratch_mount
$here/src/feature -U $SCRATCH_DEV && \
_notrun "UQuota enabled, test needs controlled xfsdump output"
_notrun "GQuota enabled, test needs controlled xfsdump output"
$here/src/feature -P $SCRATCH_DEV && \
_notrun "PQuota enabled, test needs controlled xfsdump output"
_notrun "GQuota enabled, test needs controlled xfsdump output"
$here/src/feature -P $SCRATCH_DEV && \
_notrun "PQuota enabled, test needs controlled xfsdump output"
#
# adding - touch/echo, mkdir
#
# adding - touch/echo, mkdir
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
_require_scratch
rm -f $seqres.full
_require_scratch
rm -f $seqres.full
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
_scratch_mkfs_xfs >/dev/null || _fail "mkfs failed"
_scratch_mount >/dev/null || _fail "mount failed"
_scratch_mkfs_xfs >/dev/null || _fail "mkfs failed"
_scratch_mount >/dev/null || _fail "mount failed"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
umount $imgs.loop 2>/dev/null
[ -d $imgs.loop ] && rmdir $imgs.loop
umount $imgs.source_dir 2>/dev/null
umount $imgs.loop 2>/dev/null
[ -d $imgs.loop ] && rmdir $imgs.loop
umount $imgs.source_dir 2>/dev/null
echo
echo === populating scratch device
_populate_scratch
echo
echo === populating scratch device
_populate_scratch
-umount $SCRATCH_MNT 2>/dev/null
+_scratch_unmount 2>/dev/null
echo
echo === copying scratch device to single target
echo
echo === copying scratch device to single target
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup_logfiles
rm -f $tmp.*
echo "*** unmount"
_cleanup_logfiles
rm -f $tmp.*
echo "*** unmount"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_require_v2log
echo "*** init FS"
_require_v2log
echo "*** init FS"
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
# do a simple quota test to ensure DQUOT data is happening
export MOUNT_OPTIONS="-o quota,gquota"
# do a simple quota test to ensure DQUOT data is happening
export MOUNT_OPTIONS="-o quota,gquota"
_scratch_mkfs_xfs "-l version=1" 1>/dev/null 2>&1
_qmount
src/feature -u $SCRATCH_DEV || _notrun "No quota support at mount time"
_scratch_mkfs_xfs "-l version=1" 1>/dev/null 2>&1
_qmount
src/feature -u $SCRATCH_DEV || _notrun "No quota support at mount time"
_mkfs_log "-l version=1"
_create_log
_mkfs_log "-l version=1"
_create_log
cd /
_cleanup_logfiles
rm -f $tmp.*
cd /
_cleanup_logfiles
rm -f $tmp.*
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_link_out_file_named $seqfull.op $(_get_os_name)
echo "*** init FS"
_link_out_file_named $seqfull.op $(_get_os_name)
echo "*** init FS"
-umount $SCRATCH_DEV >/dev/null 2>&1
+_scratch_unmount >/dev/null 2>&1
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt start-blk
cat >$tmp.seq.params <<EOF
# mkfs-opt mount-opt start-blk
done
wait # stop for any remaining stress processes
done
wait # stop for any remaining stress processes
id=$prid
test_xfs_quota | filter_xfs_quota
id=$prid
test_xfs_quota | filter_xfs_quota
# real QA test starts here
rm -f $tmp.projects $seqres.full
# real QA test starts here
rm -f $tmp.projects $seqres.full
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seqres.full
_scratch_mount
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seqres.full
_scratch_mount
gid=2
prid=3
export QARGS="-x -D /dev/null -P /dev/null $SCRATCH_MNT"
gid=2
prid=3
export QARGS="-x -D /dev/null -P /dev/null $SCRATCH_MNT"
echo; echo "### test user accounting"
export MOUNT_OPTIONS="-ouquota"
echo; echo "### test user accounting"
export MOUNT_OPTIONS="-ouquota"
id=$uid
test_files
test_accounting
id=$uid
test_files
test_accounting
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
echo; echo "### test group accounting"
export MOUNT_OPTIONS="-ogquota"
echo; echo "### test group accounting"
export MOUNT_OPTIONS="-ogquota"
id=$gid
test_files
test_accounting
id=$gid
test_files
test_accounting
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
#echo; echo "### test project accounting"
export MOUNT_OPTIONS="-opquota"
#echo; echo "### test project accounting"
export MOUNT_OPTIONS="-opquota"
id=$prid
test_files
test_accounting
id=$prid
test_files
test_accounting
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
done
echo "flushing changes via umount/mount."
done
echo "flushing changes via umount/mount."
}
# real QA test starts here
}
# real QA test starts here
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mount
# see if faststart is possible (and requested)
_scratch_mount
# see if faststart is possible (and requested)
if [ -n "$FASTSTART" -a -f $SCRATCH_MNT/f0 ]; then
faststart="-N" # causes us to skip the mkfs step
fi
if [ -n "$FASTSTART" -a -f $SCRATCH_MNT/f0 ]; then
faststart="-N" # causes us to skip the mkfs step
fi
_scratch_mkfs_xfs -dsize=160m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seqres.full
_scratch_mkfs_xfs -dsize=160m,agcount=4 $faststart | _filter_mkfs 2>$tmp.mkfs
cat $tmp.mkfs >>$seqres.full
_require_scratch
# real QA test starts here
_require_scratch
# real QA test starts here
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
STR1=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
STR1=AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
[ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
# real QA test starts here
[ "$XFS_FSR_PROG" = "" ] && _notrun "xfs_fsr not found"
# real QA test starts here
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
MKFS_OPTIONS="-bsize=4096"
MOUNT_OPTIONS="-o noatime"
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
MKFS_OPTIONS="-bsize=4096"
MOUNT_OPTIONS="-o noatime"
_scratch_mkfs_xfs | _filter_mkfs 2>$tmp.mkfs
# Roughly the middle of the created inodes
INO=`ls -i $SCRATCH_MNT/512 | awk '{print $1}'`
# Roughly the middle of the created inodes
INO=`ls -i $SCRATCH_MNT/512 | awk '{print $1}'`
# Figure out where that middle inode starts
BYTE=`$XFS_DB_PROG -c "convert inode $INO byte" $SCRATCH_DEV \
# Figure out where that middle inode starts
BYTE=`$XFS_DB_PROG -c "convert inode $INO byte" $SCRATCH_DEV \
$XFS_FSR_PROG $SCRATCH_MNT | _filter_scratch
# Fix up intentional corruption so test can pass
$XFS_FSR_PROG $SCRATCH_MNT | _filter_scratch
# Fix up intentional corruption so test can pass
$XFS_REPAIR_PROG $SCRATCH_DEV >> $seqres.full 2>&1
status=0
$XFS_REPAIR_PROG $SCRATCH_DEV >> $seqres.full 2>&1
status=0
_require_scratch
_require_xfs_quota
_require_scratch
_require_xfs_quota
-mkfs.xfs -f $SCRATCH_DEV >/dev/null 2>&1
-mount -o uquota $SCRATCH_DEV $SCRATCH_MNT
-umount $SCRATCH_MNT
+_scratch_mkfs >/dev/null 2>&1
+_scratch_mount "-o uquota"
+_scratch_unmount
xfs_db -r -c sb -c print $SCRATCH_DEV | grep qflags
xfs_db -r -c sb -c print $SCRATCH_DEV | grep qflags
-mount $SCRATCH_DEV $SCRATCH_MNT
-umount $SCRATCH_MNT
+_scratch_mount
+_scratch_unmount
xfs_db -r -c sb -c print $SCRATCH_DEV | grep qflags
# success, all done
xfs_db -r -c sb -c print $SCRATCH_DEV | grep qflags
# success, all done
wait 2>/dev/null
echo "unmount"
wait 2>/dev/null
echo "unmount"
echo "logprint after going down..."
_print_logstate
echo "logprint after going down..."
_print_logstate
src/godown -v -f $SCRATCH_MNT >> $seqres.full
echo "unmount"
src/godown -v -f $SCRATCH_MNT >> $seqres.full
echo "unmount"
echo "logprint after going down..."
_print_logstate
echo "logprint after going down..."
_print_logstate
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
xfs_db -r -c "inode $inum" -c "print" $SCRATCH_DEV |\
awk '
/nextents/ { print; next }
xfs_db -r -c "inode $inum" -c "print" $SCRATCH_DEV |\
awk '
/nextents/ { print; next }
xfs_db -r -c "inode $inum" -c "print u" $SCRATCH_DEV
_scratch_mount
}
_print_inode_a()
{
xfs_db -r -c "inode $inum" -c "print u" $SCRATCH_DEV
_scratch_mount
}
_print_inode_a()
{
xfs_db -r -c "inode $inum" -c "print a" $SCRATCH_DEV
_scratch_mount
}
xfs_db -r -c "inode $inum" -c "print a" $SCRATCH_DEV
_scratch_mount
}
- umount $SCRATCH_DEV 2>/dev/null
+ _scratch_unmount 2>/dev/null
_notrun "GQuota are enabled, test needs controlled sb recovery"
src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
_notrun "GQuota are enabled, test needs controlled sb recovery"
src/feature -P $SCRATCH_DEV && \
_notrun "PQuota are enabled, test needs controlled sb recovery"
fi
clear=""
eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | $PERL_PROG -ne '
fi
clear=""
eval `xfs_db -r -c "sb 1" -c stack $SCRATCH_DEV | $PERL_PROG -ne '
# test that we have DMAPI support
_dmapi_scratch_mount
# test that we have DMAPI support
_dmapi_scratch_mount
-umount $SCRATCH_MNT > /dev/null 2>&1
+_scratch_unmount > /dev/null 2>&1
# _test_punch args: blksize extsize_hint filesize "pp1 pp2 pp3" \
# "ps1 ps2 ps3" "pt1 pt2 pt3" "wp1 wp2" "ws1 ws2" \
# _test_punch args: blksize extsize_hint filesize "pp1 pp2 pp3" \
# "ps1 ps2 ps3" "pt1 pt2 pt3" "wp1 wp2" "ws1 ws2" \
# test that we have DMAPI support
_dmapi_scratch_mount
# test that we have DMAPI support
_dmapi_scratch_mount
-umount $SCRATCH_MNT > /dev/null 2>&1
+_scratch_unmount > /dev/null 2>&1
# _test_punch args: blksize extsize_hint filesize "pp1 pp2 pp3" \
# "ps1 ps2 ps3" "pt1 pt2 pt3" "wp1 wp2" "ws1 ws2" \
# _test_punch args: blksize extsize_hint filesize "pp1 pp2 pp3" \
# "ps1 ps2 ps3" "pt1 pt2 pt3" "wp1 wp2" "ws1 ws2" \
# test that we have DMAPI support
_dmapi_scratch_mount
# test that we have DMAPI support
_dmapi_scratch_mount
-umount $SCRATCH_MNT > /dev/null 2>&1
+_scratch_unmount > /dev/null 2>&1
_scratch_mkfs_xfs >/dev/null 2>&1 \
|| _fail "mkfs failed"
_scratch_mkfs_xfs >/dev/null 2>&1 \
|| _fail "mkfs failed"
$here/src/bulkstat_unlink_test 20 1000 3 $SCRATCH_MNT/bulkstat
# Mount scratch with ikeep enabled
$here/src/bulkstat_unlink_test 20 1000 3 $SCRATCH_MNT/bulkstat
# Mount scratch with ikeep enabled
_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT" \
|| _fail "mount failed"
_scratch_mount "-o dmapi,mtpt=$SCRATCH_MNT" \
|| _fail "mount failed"
echo "logprint after going down..."
_print_logstate
echo "logprint after going down..."
_print_logstate
src/godown -v -f $SCRATCH_MNT >> $seqres.full
echo "unmount"
src/godown -v -f $SCRATCH_MNT >> $seqres.full
echo "unmount"
echo "logprint after going down..."
_print_logstate
echo "logprint after going down..."
_print_logstate
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
_putback_scratch_fstab
rm -f $tmp.*
}
_putback_scratch_fstab
rm -f $tmp.*
}
_check_mount rw filestreams
done
_check_mount rw filestreams
done
# remount ignores attr2, and noattr2 mount option does does not result
# in any "attr2" specific option in /proc/mounts, so we can only check
# remount ignores attr2, and noattr2 mount option does does not result
# in any "attr2" specific option in /proc/mounts, so we can only check
touch $SCRATCH_MNT/foobar
[ $? -eq 0 ] || echo "touch (1) failed unexpectedly"
touch $SCRATCH_MNT/foobar
[ $? -eq 0 ] || echo "touch (1) failed unexpectedly"
_scratch_mount -o ro
[ $? -eq 0 ] || echo "mount (2) failed unexpectedly"
_scratch_mount -o ro
[ $? -eq 0 ] || echo "mount (2) failed unexpectedly"
touch $SCRATCH_MNT/foobar
[ $? -eq 0 ] || echo "touch (2) failed unexpectedly"
touch $SCRATCH_MNT/foobar
[ $? -eq 0 ] || echo "touch (2) failed unexpectedly"
[ $? -eq 0 ] || _fail "remount barrier failed"
_check_mount rw
[ $? -eq 0 ] || _fail "remount barrier failed"
_check_mount rw
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
- umount $SCRATCH_MNT >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
_scratch_mount
xfs_db -x $SCRATCH_DEV -c 'sb' -c 'write features2 0'
_scratch_mount
rwf2=`get_features features2`
#
rwf2=`get_features features2`
#
#
_scratch_mount -o ro
_scratch_mount -o remount,rw
#
_scratch_mount -o ro
_scratch_mount -o remount,rw
rof2=`get_features features2`
[ "$f2" != "$bf2" ] && echo "mkfs: features2 $f2 != bad_features2 $bf2"
rof2=`get_features features2`
[ "$f2" != "$bf2" ] && echo "mkfs: features2 $f2 != bad_features2 $bf2"
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
- umount $SCRATCH_DEV >/dev/null 2>&1
+ _scratch_unmount >/dev/null 2>&1
}
trap "_cleanup; exit \$status" 0 1 2 3 15
}
trap "_cleanup; exit \$status" 0 1 2 3 15
xfs_quota -x -c off $SCRATCH_DEV
# and unmount (this used to crash)
xfs_quota -x -c off $SCRATCH_DEV
# and unmount (this used to crash)
# create scratch filesystem
_scratch_mkfs_xfs >/dev/null 2>&1
# create scratch filesystem
_scratch_mkfs_xfs >/dev/null 2>&1
xfs_quota -x -c off -c remove $SCRATCH_DEV
# and unmount again
xfs_quota -x -c off -c remove $SCRATCH_DEV
# and unmount again
fragment_freespace
# unmount and remount to reset all allocator indexes
fragment_freespace
# unmount and remount to reset all allocator indexes
_scratch_mount
# create a range of source files, then fsr them to a known size
_scratch_mount
# create a range of source files, then fsr them to a known size
echo "--- silence is golden ---"
status=0 ; exit
echo "--- silence is golden ---"
status=0 ; exit
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
fi
# Do testing on filesystem with projid32bit feature enabled
fi
# Do testing on filesystem with projid32bit feature enabled
-umount $SCRATCH_DEV 2>/dev/null
+_scratch_unmount 2>/dev/null
_scratch_mkfs_xfs -i projid32bit=1 >> $seqres.full || _fail "mkfs failed"
_qmount
mkdir $dir
_scratch_mkfs_xfs -i projid32bit=1 >> $seqres.full || _fail "mkfs failed"
_qmount
mkdir $dir
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
$XFS_IO_PROG -r -c "lsproj" $dir/16bit
$XFS_IO_PROG -r -c "lsproj" $dir/32bit
$XFS_IO_PROG -r -c "lsproj" $dir/16bit
$XFS_IO_PROG -r -c "lsproj" $dir/32bit
# Now, enable projid32bit support by xfs_admin
xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed"
# Now, enable projid32bit support by xfs_admin
xfs_admin -p $SCRATCH_DEV >> $seqres.full 2>&1 || _fail "xfs_admin failed"
$XFS_IO_PROG -r -c "lsproj" $restore_dir/32bit
$XFS_IO_PROG -r -c "lsproj" $restore_dir/32bitv2
$XFS_IO_PROG -r -c "lsproj" $restore_dir/32bit
$XFS_IO_PROG -r -c "lsproj" $restore_dir/32bitv2
# Now, we can examine the file systems with xfs_db
echo "These two values of 16bit project quota ids shall be the same"
# Now, we can examine the file systems with xfs_db
echo "These two values of 16bit project quota ids shall be the same"
- umount $SCRATCH_MNT 2>/dev/null
+ _scratch_unmount 2>/dev/null
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
rm -f $tmp.*
}
trap "_cleanup; exit \$status" 0 1 2 3 15
_exercise u
echo "*** unmount"
_exercise u
echo "*** unmount"
_scratch_mkfs_xfs -m crc=1 2>/dev/null | _filter_mkfs 2>$tmp.mkfs
_scratch_mkfs_xfs -m crc=1 2>/dev/null | _filter_mkfs 2>$tmp.mkfs
_exercise pno
echo "*** unmount"
_exercise pno
echo "*** unmount"
# success, all done
status=0
# success, all done
status=0
xfs_quota -x -c 'off -g' $SCRATCH_MNT
rmdir $QUOTA_DIR
echo "*** umount"
xfs_quota -x -c 'off -g' $SCRATCH_MNT
rmdir $QUOTA_DIR
echo "*** umount"
_qmount
mkdir -p $QUOTA_DIR
_qmount
mkdir -p $QUOTA_DIR
xfs_quota -x -c 'off -p' $SCRATCH_MNT
rmdir $QUOTA_DIR
echo "*** umount"
xfs_quota -x -c 'off -p' $SCRATCH_MNT
rmdir $QUOTA_DIR
echo "*** umount"
_qmount
mkdir -p $QUOTA_DIR
_qmount
mkdir -p $QUOTA_DIR
xfs_quota -x -c 'off -gp' $SCRATCH_MNT
rmdir $QUOTA_DIR
echo "*** umount"
xfs_quota -x -c 'off -gp' $SCRATCH_MNT
rmdir $QUOTA_DIR
echo "*** umount"
# success, all done
status=0
# success, all done
status=0