The old rbtree implement of ref_head->ref_root sacrificed the insert order to do better delayed_ref_node merging. However the out of order behavior makes btrfs_find_all_roots() unable to find correct root, since it needs the insert order to skip later delayed_nodes.
Without such ability, qgroup can never be accurate (although it is never accurate anyway, :-( ). This patchset first fix a small but deadly (only for qgroup) bug in backref, which will cause btrfs_find_all_roots() return result less than expected one. And the second patch do migrate from rb_tree implement to new list implement, and still maintain the ability to merge delayed_ref_nodes. The last patch will cleanup the unused rb_tree implement only functions. The new list implement is in a simpler logic and code base (removes about 200 lines). Qu Wenruo (3): btrfs: backref: Don't merge refs which are not for same block. btrfs: delayed-ref: Use list to replace the ref_root in ref_head. btrfs: delayed-ref: Cleanup the unneeded functions. fs/btrfs/backref.c | 15 +-- fs/btrfs/delayed-ref.c | 311 ++++++++++++------------------------------------- fs/btrfs/delayed-ref.h | 18 ++- fs/btrfs/disk-io.c | 8 +- fs/btrfs/extent-tree.c | 46 ++------ 5 files changed, 108 insertions(+), 290 deletions(-) -- 2.3.4 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html