[PATCH v2 2/2] btrfs: Verify every chunk has corresponding block group at mount time

2018-07-05 Thread Qu Wenruo
If a crafted btrfs has missing block group items, it could cause unexpected behavior and breaks our expectation on 1:1 chunk<->block group mapping. Although we added block group -> chunk mapping check, we still need chunk -> block group mapping check. This patch will do extra check to ensure each

[PATCH v2 2/2] btrfs: Verify every chunk has corresponding block group at mount time

2018-07-03 Thread Qu Wenruo
Reported in https://bugzilla.kernel.org/show_bug.cgi?id=199847, the image has empty extent tree. Although that image also has empty root tree, thus can be catched by tree checker on empty leaves, but if a crafted btrfs has missing block group items, it could still cause problem. This patch will d