All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] Qgroup comment enhance and balance fix
@ 2016-10-18  1:31 Qu Wenruo
  2016-10-18  1:31 ` [PATCH 1/4] btrfs: qgroup: Add comments explaining how btrfs qgroup works Qu Wenruo
                   ` (5 more replies)
  0 siblings, 6 replies; 13+ messages in thread
From: Qu Wenruo @ 2016-10-18  1:31 UTC (permalink / raw)
  To: linux-btrfs; +Cc: rgoldwyn, rgoldwyn

The patchset does the following things:
1) Enhance comment for qgroup, rename 2 functions
   Explain the how qgroup works, so new developers won't waste too much
   time digging into the boring codes.

   The qgroup work flow is split into 3 main phrases:
   Reverse, Trace, Account.
   And rename functions like btrfs_qgroup_insert_dirty_extent_record()
   to btrfs_qgroup_trace_extent(), to follow the "Trace" phrase.

   Other function name already follows such schema before.

2) Move account_shared_subtree() and account_leaf_items() to qgroup.c
   Such functions are only used by qgroup, so move them to qgroup.c and
   rename them to follow "trace" schema.

3) Fix the long standing qgroup balance corruption
   Commit 62b99540a1d91e4 doesn't fix the problem completely.
   It can only handle case that merge_reloc_roots() are all done in one
   transaction.

   If transaction commits during merge_reloc_roots(), the data extents
   will leak again.

   The tree fix is to info qgroup to trace both subtree(tree reloc tree
   and destination fs tree), at replace_path() time.
   Inside  replace_path(), there is one transaction start and end, so we
   must make qgroup to trace both subtrees.

   Thanks for previous work, now we can easily trace subtree, so the fix
   is quite simple now.

   And the cause also makes it easier to create pinpoint test case for
   this bug.

Qu Wenruo (4):
  btrfs: qgroup: Add comments explaining how btrfs qgroup works
  btrfs: qgroup: Rename functions to make it follow
    reserve,trace,account steps
  btrfs: Expoert and move leaf/subtree qgroup helpers to qgroup.c
  btrfs: qgroup: Fix qgroup data leaking by using subtree tracing

 fs/btrfs/delayed-ref.c       |   2 +-
 fs/btrfs/extent-tree.c       | 220 +------------------------------------------
 fs/btrfs/qgroup.c            | 219 +++++++++++++++++++++++++++++++++++++++++-
 fs/btrfs/qgroup.h            |  64 +++++++++++--
 fs/btrfs/relocation.c        | 119 +++++------------------
 fs/btrfs/tree-log.c          |   2 +-
 include/trace/events/btrfs.h |   2 +-
 7 files changed, 302 insertions(+), 326 deletions(-)

-- 
2.10.0




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2016-11-07 17:59 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-18  1:31 [PATCH 0/4] Qgroup comment enhance and balance fix Qu Wenruo
2016-10-18  1:31 ` [PATCH 1/4] btrfs: qgroup: Add comments explaining how btrfs qgroup works Qu Wenruo
2016-11-03 18:49   ` Goldwyn Rodrigues
2016-10-18  1:31 ` [PATCH 2/4] btrfs: qgroup: Rename functions to make it follow reserve,trace,account steps Qu Wenruo
2016-11-03 18:49   ` Goldwyn Rodrigues
2016-10-18  1:31 ` [PATCH 3/4] btrfs: Expoert and move leaf/subtree qgroup helpers to qgroup.c Qu Wenruo
2016-11-03 18:50   ` Goldwyn Rodrigues
2016-10-18  1:31 ` [PATCH 4/4] btrfs: qgroup: Fix qgroup data leaking by using subtree tracing Qu Wenruo
2016-11-03 18:50   ` Goldwyn Rodrigues
2016-10-28  0:33 ` [PATCH 0/4] Qgroup comment enhance and balance fix Qu Wenruo
2016-10-28 15:03   ` Goldwyn Rodrigues
2016-10-31 17:00   ` David Sterba
2016-11-07 17:59 ` David Sterba

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.