]> www.infradead.org Git - users/hch/xfstests-dev.git/commitdiff
btrfs/254: don't leave mount on test fs in case of failure/interruption
authorFilipe Manana <fdmanana@suse.com>
Wed, 19 Feb 2025 18:19:14 +0000 (18:19 +0000)
committerZorro Lang <zlang@kernel.org>
Fri, 21 Feb 2025 14:50:39 +0000 (22:50 +0800)
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 <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Reviewed-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Anand Jain <anand.jain@oracle.com>
tests/btrfs/254

index d9c9eea9c7bf231248c128b0da425a78e91c64dc..7bf4210a9277d071098785d0f57ff4e0b4c78a86 100755 (executable)
@@ -21,6 +21,7 @@ _cleanup()
 {
        cd /
        rm -f $tmp.*
+       _unmount $seq_mnt
        rm -rf $seq_mnt > /dev/null 2>&1
        cleanup_dmdev
 }