summaryrefslogtreecommitdiff
path: root/tests/btrfs/164
diff options
context:
space:
mode:
authorQu Wenruo <wqu@suse.com>2021-02-25 13:57:17 +0800
committerEryu Guan <guaneryu@gmail.com>2021-03-07 23:44:18 +0800
commit46f896c0a55d4fd979f473dcd5742f67746e66ec (patch)
tree9368b5d91ae106c2e738b0fdf3c2b373fe4a8076 /tests/btrfs/164
parentbdad282d47daddc0f2f7f18f30bd25a636535de4 (diff)
btrfs: make sure we rescan all devices after unregistering
There are some btrfs test cases utilizing _btrfs_forget_or_module_reload() to unregister all btrfs devices. However _btrfs_forget_or_module_reload() will unregister all devices, meaning if TEST_DEV is part of a multi-device btrfs, after those test cases TEST_DEV will no longer be mountable. This patch will introduce a new function, btrfs_rescan_devices() to undo the unregister, so that all later test cases can mount TEST_DEV without any problem. Since we are here, also add a missing _require_btrfs_forget_or_module_loadable for btrfs/225. Reported-by: Eric Sandeen <sandeen@sandeen.net> Signed-off-by: Qu Wenruo <wqu@suse.com> Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: Eryu Guan <guaneryu@gmail.com>
Diffstat (limited to 'tests/btrfs/164')
-rwxr-xr-xtests/btrfs/1642
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/btrfs/164 b/tests/btrfs/164
index 55d4a683..ad22b6a4 100755
--- a/tests/btrfs/164
+++ b/tests/btrfs/164
@@ -22,6 +22,7 @@ _cleanup()
{
cd /
rm -f $tmp.*
+ _btrfs_rescan_devices
}
# get standard environment, filters and checks
@@ -90,6 +91,7 @@ delete_seed
seed_is_mountable
_scratch_dev_pool_put
+_btrfs_rescan_devices
status=0
exit