linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Shilong <wangshilong1991@gmail.com>
To: linux-btrfs@vger.kernel.org
Cc: guihc.fnst@cn.fujitsu.com
Subject: [PATCH] Btrfs-progs: chunk-recover: use right size when allocating chunk root node
Date: Wed, 27 Nov 2013 22:43:56 +0800	[thread overview]
Message-ID: <1385563436-2598-1-git-send-email-wangshilong1991@gmail.com> (raw)

From: Wang Shilong <wangsl.fnst@cn.fujitsu.com>

When allocating chunk root node, we should use nodesize rather than sectorsize,
this will casue regression when making other nodesize choice.(for example 16k size now)

Reported-by: Gui Hecheng <guihc.fnst@cn.fujitsu.com>
Signed-off-by: Wang Shilong <wangsl.fnst@cn.fujitsu.com>
---
 chunk-recover.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/chunk-recover.c b/chunk-recover.c
index bcde39e..ef96921 100644
--- a/chunk-recover.c
+++ b/chunk-recover.c
@@ -1034,7 +1034,7 @@ static int __rebuild_chunk_root(struct btrfs_trans_handle *trans,
 	disk_key.type = BTRFS_DEV_ITEM_KEY;
 	disk_key.offset = min_devid;
 
-	cow = btrfs_alloc_free_block(trans, root, root->sectorsize,
+	cow = btrfs_alloc_free_block(trans, root, root->nodesize,
 				     BTRFS_CHUNK_TREE_OBJECTID,
 				     &disk_key, 0, 0, 0);
 	btrfs_set_header_bytenr(cow, cow->start);
-- 
1.8.4

--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-

                 reply	other threads:[~2013-11-27 14:44 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1385563436-2598-1-git-send-email-wangshilong1991@gmail.com \
    --to=wangshilong1991@gmail.com \
    --cc=guihc.fnst@cn.fujitsu.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).