]> www.infradead.org Git - users/hch/xfstests-dev.git/commit
btrfs/081: wait for reader process to exit before cycle mounting
authorFilipe Manana <fdmanana@suse.com>
Fri, 28 Jun 2024 17:04:49 +0000 (18:04 +0100)
committerZorro Lang <zlang@kernel.org>
Fri, 12 Jul 2024 19:05:35 +0000 (03:05 +0800)
commitb3b323777a54b6883d3254c06cf0a840e80e2465
tree5b0e0def210a660df101ce5f164df275ecc1188c
parent244598226928847b8c234b94116a80347330054e
btrfs/081: wait for reader process to exit before cycle mounting

We send a kill signal to the reader process, check the md5sum of the
files and then cycle mount the scratch device. Most of the time the
reader process has already terminated before we attempt the cycle mount,
but sometimes it may still be alive in which case the cat command
executed by the reader process may fail because the scratch fs was
unmounted and the target file doesn't exist. This makes the cat command
print an error message and the test fail like this:

     Verifying file digests after cloning
     14968c092c68e32fa35e776392d14523  SCRATCH_MNT/foo
     14968c092c68e32fa35e776392d14523  SCRATCH_MNT/bar
    +cat: /opt/scratch/bar: No such file or directory
    +cat: /opt/scratch/bar: No such file or directory
    +cat: /opt/scratch/bar: No such file or directory
    +cat: /opt/scratch/bar: No such file or directory
    ...
    (Run diff -u /opt/xfstests/tests/btrfs/081.out

Fix this by making the test wait for the reader to terminate after
sending it the kill signal.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Signed-off-by: Zorro Lang <zlang@kernel.org>
tests/btrfs/081