btrfs: test fstrim after doing a device replace
authorFilipe Manana <fdmanana@suse.com>
Wed, 23 Sep 2020 14:31:47 +0000 (15:31 +0100)
committerEryu Guan <guaneryu@gmail.com>
Sun, 27 Sep 2020 09:44:38 +0000 (17:44 +0800)
commit353bfccf5cdd5cdb24914cc846ffbc1cf828c51b
treed2dc06d54a9ecbace65696eb69db0252eb9e25eb
parent6e723496c1bc2812dbe920578d4c291bbf33d6a7
btrfs: test fstrim after doing a device replace

Test that after replacing a device, if we run fstrim against the filesystem
we do not trim/discard allocated chunks in the new device. We verify that
allocated chunks in the new device were not trim/discarded by mounting the
new device only in degraded mode, as this is the easiest way to verify it.

This currently fails on btrfs (since kernel 5.2) and is fixed by a patch
that has the following subject:

  "btrfs: fix filesystem corruption after a device replace"

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/btrfs/223 [new file with mode: 0755]
tests/btrfs/223.out [new file with mode: 0644]
tests/btrfs/group