btrfs: Add test for corrupted childless qgroup numbers
authorQu Wenruo <wqu@suse.com>
Mon, 13 Aug 2018 05:22:05 +0000 (13:22 +0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 19 Aug 2018 12:10:58 +0000 (20:10 +0800)
commit55566e7f7cdd94ec0c5813aa8652cef3faa865c6
tree73478c23d3cbeafe41e5a83d59c7c2899fcdd682
parentc2c34214652a49aadce6349f6aa4d0955c82801e
btrfs: Add test for corrupted childless qgroup numbers

This bug is exposed by populating a high level qgroup, and then make
it childless with old qgroup numbers, and finally do rescan.

Normally rescan should zero out all qgroups' accounting number, but
due to a kernel bug which won't mark childless qgroups dirty, their
on-disk data is never updated, thus old numbers remain and cause
qgroup corruption.

Fixed by the following kernel patch:
"btrfs: qgroup: Dirty all qgroups before rescan"

[Eryu: removed useless _filter_xfs_io]

Reported-by: Misono Tomohiro <misono.tomohiro@jp.fujitsu.com>
Signed-off-by: Qu Wenruo <wqu@suse.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
common/filter.btrfs
tests/btrfs/171 [new file with mode: 0755]
tests/btrfs/171.out [new file with mode: 0644]
tests/btrfs/group