On Mon, May 14, 2018 at 09:38:11AM +0800, Qu Wenruo wrote: > This patchset is mainly focused on fixing qgroup rescan corruption. > > Since the whole btrfs qgroup is based on the modification between 2 > transactions, it only has correct qgroup delta. > While if the rescan can't provide a correct result from the very > beginning, qgroup numbers are corrupted. > > The patchset is fixing two types of qgroup corruption which could happen > by looping btrfs/017 with some possibility. > > 1) Not accounting tree blocks > Caused by the fact that qgroup rescan only searches commit root for > backref, while we're passing current extent root to search. > Fix it by also passing commit extent root. > > 2) Double accounting tree blocks > Caused by wrong rescan exit condition. > Currently qgroup only exit when it can't find any leaves beyond > rescan progress. > However it could cause problem when new transaction happens after > last rescan, and old leaves CoWed to new location, and double > accounting could happen. > Fix it by checking and leave qgroup rescan if we have hit last leaf, > instead of leaving it to next leaf rescan. > > > Changelog: > v2: > Remove unused tree_mod_seq_elem for the 1st patch. > Fix double unlock in 2nd patch. > Thanks Jeff for the update. V1 patches replaced, thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html
