btrfs: make sure we rescan all devices after unregistering
authorQu Wenruo <wqu@suse.com>
Thu, 25 Feb 2021 05:57:17 +0000 (13:57 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Mar 2021 15:44:18 +0000 (23:44 +0800)
commit46f896c0a55d4fd979f473dcd5742f67746e66ec
tree9368b5d91ae106c2e738b0fdf3c2b373fe4a8076
parentbdad282d47daddc0f2f7f18f30bd25a636535de4
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>
common/btrfs
tests/btrfs/124
tests/btrfs/125
tests/btrfs/163
tests/btrfs/164
tests/btrfs/219
tests/btrfs/225