linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: <linux-btrfs@vger.kernel.org>
Cc: <dsterba@suse.com>
Subject: [PATCH 3/4] btrfs: extent-tree: Avoid allocating tree block that cross stripe boundary
Date: Thu, 23 Jul 2015 17:18:09 +0800	[thread overview]
Message-ID: <1437643090-13920-4-git-send-email-quwenruo@cn.fujitsu.com> (raw)
In-Reply-To: <1437643090-13920-1-git-send-email-quwenruo@cn.fujitsu.com>

Now find_free_extent() function won't return a metadata extent that
cross stripe boundary.

Reported-by: Chris Murphy <lists@colorremedies.com>
Reported-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Zhao Lei <zhaolei@cn.fujitsu.com>
Signed-off-by: Qu Wenruo <quwenruo@cn.fujitsu.com>
---
 extent-tree.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/extent-tree.c b/extent-tree.c
index ac582e0..6f07e4b 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -2605,6 +2605,11 @@ check_failed:
 	}
 
 	if (!(data & BTRFS_BLOCK_GROUP_DATA)) {
+		if (check_crossing_stripes(ins->objectid, num_bytes)) {
+			search_start = round_down(ins->objectid + num_bytes,
+						  BTRFS_STRIPE_LEN);
+			goto new_group;
+		}
 		block_group = btrfs_lookup_block_group(info, ins->objectid);
 		if (block_group)
 			trans->block_group = block_group;
-- 
2.4.6


  parent reply	other threads:[~2015-07-23  9:18 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 ` Qu Wenruo [this message]
2015-07-23  9:18 ` [PATCH 4/4] btrfs: convert: Avoid allocating metadata extent " 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1437643090-13920-4-git-send-email-quwenruo@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=dsterba@suse.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).