]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
fstests: clean up mount and unmount operations
authorDave Chinner <dchinner@redhat.com>
Tue, 26 Nov 2024 20:56:55 +0000 (07:56 +1100)
committerZorro Lang <zlang@kernel.org>
Sun, 8 Dec 2024 14:06:24 +0000 (22:06 +0800)
commit4c6bc4565105e6a6844664cbcd0171678a6deeda
treef255fa2fe1f9165a36f80302e7994c11336d1ef4
parentf8d5367e01a7c859c3378a76b6afc047728b7652
fstests: clean up mount and unmount operations

The way tests run unmount is, at times, completely random.
Sometimes they call the correct _scratch_unmount function, sometimes
they open code it with a direct call to UMOUNT_PROG <dir>, sometimes
they run umount directly.

This makes it really hard to instrument unmount operations when
trying to work out why transient, unpredictable failures like
this occur randomly during a test run:

umount: /mnt/xfs/runner-17/test: target is busy.

Sometimes it happens on a test device mount, sometimes a scratch
device mount.  Sometimes it happens to a test specific dm or loop
device mount. But without instrumenting every single unmount call in
every test, it's impossible to capture these failures easily.

Solve this problem by introducing the _unmount() wrapper. It is
simply a call to UMOUNT_PROG <dir>, but it provides a single point
were -every- unmount operation funnels through.

We already have a _mount wrapper for this reason. However, in trying
to work out why mounts were failing (because unmounts were failing),
I discovered that that_mount() is used inconsistently as well.

Sort this all out by adding and _unmount() wrapper to go with
_mount() and use them everywhere consistently.

Signed-off-by: Dave Chinner <dchinner@redhat.com>
Reviewed-by: Zorro lang <zlang@redhat.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
58 files changed:
common/btrfs
common/dmdelay
common/dmdust
common/dmerror
common/dmflakey
common/dmhugedisk
common/dmlogwrites
common/dmthin
common/overlay
common/populate
common/rc
tests/generic/042
tests/generic/050
tests/generic/067
tests/generic/081
tests/generic/085
tests/generic/108
tests/generic/171
tests/generic/172
tests/generic/173
tests/generic/174
tests/generic/306
tests/generic/332
tests/generic/361
tests/generic/373
tests/generic/374
tests/generic/395
tests/generic/459
tests/generic/563
tests/generic/604
tests/generic/631
tests/generic/648
tests/generic/698
tests/generic/699
tests/generic/704
tests/generic/717
tests/generic/730
tests/generic/731
tests/generic/732
tests/generic/741
tests/generic/744
tests/generic/746
tests/xfs/014
tests/xfs/073
tests/xfs/074
tests/xfs/078
tests/xfs/148
tests/xfs/149
tests/xfs/186
tests/xfs/216
tests/xfs/217
tests/xfs/250
tests/xfs/289
tests/xfs/507
tests/xfs/513
tests/xfs/544
tests/xfs/606
tests/xfs/613