mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Rename _scratch_mount to _scratch_cycle_mount
This makes it clear when we are using "mount ; umount" versus "mount
-o remount" for most file systems. The reason for this distinction is
(a) tests may want to test the difference between what happens on the
remount versus the munt paths, (b) with tmpfs, "mount ; umount" will
cause the contents of all of the files to disappear which makes many
tests sad, and (c) some mount options may not be changed using "mount
-o remount".
Currently _scratch_mount performs "_scratch_mount ; _scratch_umount"
so mechnically rename this function to _scratch_cycle_mount. This was
done mechnically using the script fragment:
git grep "_scratch_remount" | \
awk -F: '{print $1}' | sort -u | \
xargs sed -i 's/_scratch_remount/_scratch_cycle_mount/g'
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
This commit is contained in:
committed by
Dave Chinner
parent
9d220d1222
commit
76c21d6815
+1
-1
@@ -144,7 +144,7 @@ _defrag()
|
||||
STAT_BEFORE=`stat -c "a: %x m: %y c: %z" $1`
|
||||
$DEFRAG_PROG -v $1 >> $seqres.full 2>&1
|
||||
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
STAT_AFTER=`stat -c "a: %x m: %y c: %z" $1`
|
||||
[ ! -z $csum ] && CSUM_AFTER=`md5sum $1`
|
||||
|
||||
|
||||
@@ -329,7 +329,7 @@ _scratch_unmount()
|
||||
esac
|
||||
}
|
||||
|
||||
_scratch_remount()
|
||||
_scratch_cycle_mount()
|
||||
{
|
||||
_scratch_unmount
|
||||
_scratch_mount
|
||||
|
||||
+3
-3
@@ -80,7 +80,7 @@ dd if=/dev/zero of=$SCRATCH_MNT/subvol/bar bs=1M count=1 &> /dev/null
|
||||
echo "Setting subvol to the default"
|
||||
subvolid=$(_btrfs_get_subvolid $SCRATCH_MNT subvol)
|
||||
$BTRFS_UTIL_PROG subvolume set-default $subvolid $SCRATCH_MNT | _filter_scratch
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "List root dir which is now subvol"
|
||||
ls $SCRATCH_MNT
|
||||
_scratch_unmount
|
||||
@@ -90,7 +90,7 @@ echo "List root dir"
|
||||
ls $SCRATCH_MNT
|
||||
echo "Setting the root dir as the default again"
|
||||
$BTRFS_UTIL_PROG subvolume set-default 0 $SCRATCH_MNT | _filter_scratch
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "List root dir"
|
||||
ls $SCRATCH_MNT
|
||||
|
||||
@@ -102,7 +102,7 @@ $BTRFS_UTIL_PROG subvolume list $SCRATCH_MNT | awk '{ print $NF }'
|
||||
$BTRFS_UTIL_PROG subvolume delete $SCRATCH_MNT/snap | _filter_btrfs_subvol_delete
|
||||
echo "List root dir"
|
||||
ls $SCRATCH_MNT
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "List root dir"
|
||||
ls $SCRATCH_MNT
|
||||
|
||||
|
||||
+1
-1
@@ -88,7 +88,7 @@ _btrfs_online_defrag()
|
||||
fi
|
||||
fi
|
||||
ret_val=$?
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
# Older defrag returned "20" for success
|
||||
# e9393c2 btrfs-progs: defrag return zero on success
|
||||
if [ $ret_val -ne 0 -a $ret_val -ne 20 ]; then
|
||||
|
||||
+1
-1
@@ -99,7 +99,7 @@ $XFS_IO_PROG -d -c "pwrite -S 0xbb -b 256M 3M 256M" $SCRATCH_MNT/bar \
|
||||
echo "File digests before remounting the file system:"
|
||||
md5sum $SCRATCH_MNT/foo | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/bar | _filter_scratch
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "File digests after remounting the file system:"
|
||||
md5sum $SCRATCH_MNT/foo | _filter_scratch
|
||||
md5sum $SCRATCH_MNT/bar | _filter_scratch
|
||||
|
||||
+1
-1
@@ -149,7 +149,7 @@ test_btrfs_clone_same_file()
|
||||
# Check that after defragmenting the file and re-mounting, the file
|
||||
# content remains exactly the same as before.
|
||||
_run_btrfs_util_prog filesystem defragment $SCRATCH_MNT/foo
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
od -t x1 $SCRATCH_MNT/foo | _filter_od
|
||||
|
||||
# Verify that there are no consistency errors.
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ md5sum $SCRATCH_MNT/bar | _filter_scratch
|
||||
|
||||
# Validate the content of bar still matches foo's content even after
|
||||
# clearing all of bar's data from the page cache.
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "Verifying target file digest after umount + mount"
|
||||
md5sum $SCRATCH_MNT/bar | _filter_scratch
|
||||
|
||||
|
||||
+1
-1
@@ -121,7 +121,7 @@ $FSTRIM_PROG $SCRATCH_MNT
|
||||
|
||||
# We expect to be able to mount the fs again and have available all metadata and
|
||||
# data that got persisted in the first transaction.
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
|
||||
# We now expect file's foo content to match what it had when the first
|
||||
# transaction was committed because the second transaction was aborted and we
|
||||
|
||||
+1
-1
@@ -74,7 +74,7 @@ _run_btrfs_util_prog balance start -dusage=0 $SCRATCH_MNT
|
||||
# object was marked as full when initialized (because it had 0 total bytes),
|
||||
# which prevented the file write path from attempting to allocate a data block
|
||||
# group and fail immediately with ENOSPC.
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "hello world" > $SCRATCH_MNT/foobar
|
||||
|
||||
echo "Silence is golden"
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ test_clone_and_read_compressed_extent()
|
||||
# exclusively in the read path). The issue happened only if the same
|
||||
# readpages() call targeted pages belonging to the first and second
|
||||
# ranges that point to the same compressed extent.
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
|
||||
echo "File contents after mounting filesystem again:"
|
||||
# Must match the same contents we got before.
|
||||
|
||||
+1
-1
@@ -132,7 +132,7 @@ _run_btrfs_util_prog quota enable $SCRATCH_MNT
|
||||
_run_btrfs_util_prog quota rescan -w $SCRATCH_MNT
|
||||
|
||||
# Remount to clear cache, force everything to disk
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
|
||||
# Finally, delete snap1 to trigger btrfs_drop_snapshot(). This
|
||||
# snapshot is most interesting to delete because it will cause some
|
||||
|
||||
+1
-1
@@ -82,7 +82,7 @@ test_clone_and_read_compressed_extent()
|
||||
# bug exclusively in the read path of compressed extents, the correct
|
||||
# data was stored on disk, btrfs just failed to fill in the pages
|
||||
# correctly.
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
|
||||
echo "File contents after remount:"
|
||||
# Must match the digest we got before.
|
||||
|
||||
+1
-1
@@ -76,7 +76,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== check data contents ===="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
hexdump -C $testfile
|
||||
|
||||
rm $testfile
|
||||
|
||||
+3
-3
@@ -69,7 +69,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
@@ -94,7 +94,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
@@ -114,7 +114,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
|
||||
+3
-3
@@ -74,7 +74,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
@@ -103,7 +103,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
@@ -139,7 +139,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
|
||||
+1
-1
@@ -64,7 +64,7 @@ $testfile | _filter_xfs_io
|
||||
|
||||
echo "==== Pre-Remount ==="
|
||||
hexdump -C $testfile
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
echo "==== Post-Remount =="
|
||||
hexdump -C $testfile
|
||||
|
||||
|
||||
+1
-1
@@ -104,7 +104,7 @@ kill $syncpid
|
||||
wait
|
||||
|
||||
# clear page cache and dump the file
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
hexdump $SCRATCH_MNT/file
|
||||
|
||||
status=0
|
||||
|
||||
+1
-1
@@ -77,7 +77,7 @@ for i in $(seq 4096 8192 $endoff); do
|
||||
$XFS_IO_PROG -c "fzero -k $i 4k" $file >> $seqres.full 2>&1
|
||||
done
|
||||
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
hexdump $file
|
||||
|
||||
status=0
|
||||
|
||||
+1
-1
@@ -68,7 +68,7 @@ $XFS_IO_PROG -c "falloc 0 512K" $SCRATCH_MNT/foo
|
||||
|
||||
# Now ummount and mount again the fs. After this we expect the file's size to
|
||||
# be 512Kb.
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
|
||||
# Now check that all data we wrote before are available and the file size is
|
||||
# 512Kb.
|
||||
|
||||
+1
-1
@@ -80,7 +80,7 @@ $XFS_IO_PROG -c "pwrite -S 0xbb 256K 32K" $SCRATCH_MNT/foo | _filter_xfs_io
|
||||
# up being written to disk.
|
||||
$XFS_IO_PROG -c "truncate 160K" $SCRATCH_MNT/foo
|
||||
|
||||
_scratch_remount
|
||||
_scratch_cycle_mount
|
||||
|
||||
# We expect to see a file with a size of 160Kb, with the first 128Kb of data all
|
||||
# having the value 0xaa and the remaining 32Kb of data all having the value 0x00
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user