From: Filipe Manana Date: Wed, 19 Feb 2025 18:19:14 +0000 (+0000) Subject: btrfs/254: don't leave mount on test fs in case of failure/interruption X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7122c0315a0866989a3887aa03a27139b399536d;p=users%2Fhch%2Fxfstests-dev.git btrfs/254: don't leave mount on test fs in case of failure/interruption If the test fails or is interrupted after mounting $scratch_dev3 inside the test filesystem and before unmounting at test_add_device(), we leave without being unable to unmount the test filesystem since it has a mount inside it. This results in the need to manually unmount $scratch_dev3, otherwise a subsequent run of fstests fails since the unmount of the test device fails with -EBUSY. Fix this by unmounting $scratch_dev3 ($seq_mnt) in the _cleanup() function. Signed-off-by: Filipe Manana Reviewed-by: David Sterba Reviewed-by: Anand Jain Reviewed-by: Qu Wenruo Signed-off-by: Anand Jain --- diff --git a/tests/btrfs/254 b/tests/btrfs/254 index d9c9eea9c..7bf4210a9 100755 --- a/tests/btrfs/254 +++ b/tests/btrfs/254 @@ -21,6 +21,7 @@ _cleanup() { cd / rm -f $tmp.* + _unmount $seq_mnt rm -rf $seq_mnt > /dev/null 2>&1 cleanup_dmdev }