From 7c476f1890c5d44f21a42836db573e5703a6e1cd Mon Sep 17 00:00:00 2001 From: Filipe Manana Date: Thu, 18 Mar 2021 11:48:15 +0000 Subject: [PATCH] btrfs/232: fix umount failure due to fsstress still running We start a process that runs fsstress, then kill the process, wait for it to die and then end the test, where we attempt to unmount the fs which often fails because the fsstress subcommand started by the process is still running and using the mount point. This results in a test failure: btrfs/232 1s ... umount: /home/fdmanana/btrfs-tests/scratch_1: target is busy. _check_btrfs_filesystem: filesystem on /dev/sdc is inconsistent (see /home/fdmanana/git/hub/xfstests/results//btrfs/232.full for details) Fix that by adding a trap to the writer() function. Signed-off-by: Filipe Manana Reviewed-by: Eryu Guan Signed-off-by: Eryu Guan --- tests/btrfs/232 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/btrfs/232 b/tests/btrfs/232 index b0a04a61..b9841410 100755 --- a/tests/btrfs/232 +++ b/tests/btrfs/232 @@ -32,6 +32,10 @@ _cleanup() writer() { + # Wait for running fsstress subcommand before exitting so that + # mountpoint is not busy when we try to unmount it. + trap "wait; exit" SIGTERM + while true; do args=`_scale_fsstress_args -p 20 -n 1000 $FSSTRESS_AVOID -d $SCRATCH_MNT/stressdir` $FSSTRESS_PROG $args >/dev/null 2>&1 -- 2.30.2