mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
xfstests: do not unmount tmpfs during remount
Several tests unmount then re-mount the scratch filesystem, to check that the content is unchanged; but unmounting a tmpfs is designed to lose its content, which causes such tests to fail unnecessarily. Signed-off-by: Hugh Dickins <hughd@google.com> Signed-off-by: Junho Ryu <jayr@google.com> 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:
@@ -329,10 +329,28 @@ _scratch_unmount()
|
||||
esac
|
||||
}
|
||||
|
||||
_scratch_remount()
|
||||
{
|
||||
local opts="$1"
|
||||
|
||||
if test -n "$opts"; then
|
||||
mount -o "remount,$opts" $SCRATCH_MNT
|
||||
fi
|
||||
}
|
||||
|
||||
_scratch_cycle_mount()
|
||||
{
|
||||
local opts="$1"
|
||||
|
||||
if [ "$FSTYP" = tmpfs ]; then
|
||||
_scratch_remount "$opts"
|
||||
return
|
||||
fi
|
||||
if test -n "$opts"; then
|
||||
opts="-o $opts"
|
||||
fi
|
||||
_scratch_unmount
|
||||
_scratch_mount
|
||||
_scratch_mount "$opts"
|
||||
}
|
||||
|
||||
_test_mount()
|
||||
@@ -356,6 +374,9 @@ _test_unmount()
|
||||
|
||||
_test_cycle_mount()
|
||||
{
|
||||
if [ "$FSTYP" = tmpfs ]; then
|
||||
return
|
||||
fi
|
||||
_test_unmount
|
||||
_test_mount
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user