On Fri, Jun 28, 2024 at 06:04:49PM +0100, fdmanana@xxxxxxxxxx wrote: > From: Filipe Manana <fdmanana@xxxxxxxx> > > 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. > Reviewed-by: Boris Burkov <boris@xxxxxx> > Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx> > --- > tests/btrfs/081 | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/tests/btrfs/081 b/tests/btrfs/081 > index c3f84c77..64544da3 100755 > --- a/tests/btrfs/081 > +++ b/tests/btrfs/081 > @@ -82,6 +82,7 @@ $CLONER_PROG -s 0 -d 0 -l $(($num_extents * $extent_size)) \ > $SCRATCH_MNT/foo $SCRATCH_MNT/bar > > kill $reader_pid > /dev/null 2>&1 > +wait $reader_pid > > # Now both foo and bar should have exactly the same content. > # This didn't use to be the case before the btrfs kernel fix mentioned > -- > 2.43.0 >