btrfs: try use forget to unregister device
authorAnand Jain <anand.jain@oracle.com>
Tue, 2 Apr 2019 08:19:46 +0000 (16:19 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sat, 6 Apr 2019 11:41:47 +0000 (19:41 +0800)
commitcbae878f4110ca6e746756777f774ede788a046d
tree179fbed65c0f1061cbc7c4767fc71a377f2c0b43
parent1f139bbe014099eea76ebad31c65919d62ba782b
btrfs: try use forget to unregister device

Some btrfs test cases use btrfs module-reload to unregister devices
in the btrfs kernel. The problem with the module-reload approach is,
if test system contains btrfs as rootfs, then you can't run these
test cases.

Patches [1] introduced btrfs forget feature which can unregister
devices without the module-reload approach.

 [1]
 btrfs-progs: device scan: add new option to forget one or all scanned devices
 btrfs: introduce new ioctl to unregister a btrfs device

And this patch makes relevant changes in the fstests to use this new
feature, when available.

Signed-off-by: Anand Jain <anand.jain@oracle.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/btrfs
tests/btrfs/124
tests/btrfs/125
tests/btrfs/154
tests/btrfs/164