linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Metadata crossing stripe boundary fixes
@ 2015-07-23  9:18 Qu Wenruo
  2015-07-23  9:18 ` [PATCH 1/4] btrfs: print-tree: print stripe len of a chunk Qu Wenruo
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Qu Wenruo @ 2015-07-23  9:18 UTC (permalink / raw)
  To: linux-btrfs; +Cc: dsterba

The problem is originally reported by Chris Murphy<lists@colorremedies.com>,
and Zhao Lei digs out the root cause:
Metadata extent in mixed block group may cross stripe boundary, causing
scrub can't handle them.

For normal data/metadata separated case, as BTRFS_STRIPE_LEN(64K) can
always be divided by nodesize (4~64K, power of 2), so metadata will
never cross the stripe boundary.
But for mixed block group, data is page size(4K) aligned, breaking the
original metadata alignment, make metadata extent possible to cross
stripe boundary.

In the patchset, btrfsck will report such error and normal extent
allocate routine along with btrfs-convert will be patched to fix such
problem.

I'd like to add a test case, but it is already covered by the existing
convert test, and further more, btrfsck can only report the error with
only the 2nd patch applied.
So no good test case yet.

Kernel also needs such check, I'll check kernel codes later.

Qu Wenruo (4):
  btrfs: print-tree: print stripe len of a chunk
  btrfs: fsck: Check if a metadata tree block crossing stripe boundary
  btrfs: extent-tree: Avoid allocating tree block that cross stripe    
    boundary
  btrfs: convert: Avoid allocating metadata extent crossing stripe    
    boundary

 btrfs-convert.c | 15 ++++++++++++---
 cmds-check.c    | 28 +++++++++++++++++++++++++++-
 ctree.h         |  2 +-
 extent-tree.c   |  7 ++++++-
 print-tree.c    |  4 +++-
 volumes.h       | 10 ++++++++++
 6 files changed, 59 insertions(+), 7 deletions(-)

-- 
2.4.6


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

end of thread, other threads:[~2015-07-27 13:40 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-23  9:18 [PATCH 0/4] Metadata crossing stripe boundary fixes Qu Wenruo
2015-07-23  9:18 ` [PATCH 1/4] btrfs: print-tree: print stripe len of a chunk Qu Wenruo
2015-07-23  9:18 ` [PATCH 2/4] btrfs: fsck: Check if a metadata tree block crossing stripe boundary Qu Wenruo
2015-07-23  9:18 ` [PATCH 3/4] btrfs: extent-tree: Avoid allocating tree block that cross " Qu Wenruo
2015-07-23  9:18 ` [PATCH 4/4] btrfs: convert: Avoid allocating metadata extent crossing " Qu Wenruo
2015-07-24 12:34   ` David Sterba
2015-07-25  1:18     ` Qu Wenruo
2015-07-27 13:40       ` David Sterba
2015-07-24 12:35 ` [PATCH 0/4] Metadata crossing stripe boundary fixes David Sterba

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).