All of lore.kernel.org
 help / color / mirror / Atom feed
From: Liu Bo <bo.li.liu@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: dsterba@suse.cz
Subject: [PATCH 1/2] Btrfs-progs: make convert to allocate space from the desired type of block group
Date: Thu, 26 May 2016 18:26:49 -0700	[thread overview]
Message-ID: <1464312410-10999-1-git-send-email-bo.li.liu@oracle.com> (raw)

During btrfs-convert, it can allocate space from METADATA block
group for data, which is not supposed to be correct, although it
doesn't cause any serious problem except eating METADATA space
 more quickly.

Signed-off-by: Liu Bo <bo.li.liu@oracle.com>
---
 btrfs-convert.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/btrfs-convert.c b/btrfs-convert.c
index b49775c..550aa8f 100644
--- a/btrfs-convert.c
+++ b/btrfs-convert.c
@@ -364,6 +364,12 @@ static int custom_alloc_extent(struct btrfs_root *root, u64 num_bytes,
 			continue;
 		}
 
+		if ((!!metadata) !=
+		    (!!(cache->flags & BTRFS_BLOCK_GROUP_METADATA))) {
+			last = cache->key.objectid + cache->key.offset;
+			continue;
+		}
+
 		if (metadata) {
 			BUG_ON(num_bytes != root->nodesize);
 			if (check_crossing_stripes(start, num_bytes)) {
-- 
2.5.0


             reply	other threads:[~2016-05-27  1:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-27  1:26 Liu Bo [this message]
2016-05-27  1:26 ` [PATCH 2/2] Btrfs-progs: convert: add hint bytenr when allocating free space Liu Bo
2016-05-27  1:38 ` [PATCH 1/2] Btrfs-progs: make convert to allocate space from the desired type of block group Qu Wenruo
2016-05-27 10:55   ` David Sterba
2016-05-27 11:04     ` Qu Wenruo
2016-05-27 11:15       ` 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=1464312410-10999-1-git-send-email-bo.li.liu@oracle.com \
    --to=bo.li.liu@oracle.com \
    --cc=dsterba@suse.cz \
    --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 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.