btrfs: Add test to check if shrink works well with fstrim
authorQu Wenruo <wqu@suse.com>
Thu, 30 Jul 2020 12:17:35 +0000 (20:17 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 9 Aug 2020 15:33:30 +0000 (23:33 +0800)
commit912521c9fa1a638e31c9a83fe29062b912e9fe5b
tree3cff1414f383413397c6512787db55c7495e6367
parent2b3de458c433c4374ed8f8693896ff7be458eb17
btrfs: Add test to check if shrink works well with fstrim

There is a bug in trim code which leads to fstrim accessing beyond
device boundary.

The test case will check if fstrim, then shrink, then fstrim, all of
them works without problem.

The fix is titled "btrfs: trim: fix underflow in trim length to prevent
access beyond device boundary".

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