linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Btrfs-progs: chunk-recover: use right size when allocating chunk root node
@ 2013-11-27 14:43 Wang Shilong
  0 siblings, 0 replies; only message in thread
From: Wang Shilong @ 2013-11-27 14:43 UTC (permalink / raw)
  To: linux-btrfs; +Cc: guihc.fnst

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-

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-27 14:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-27 14:43 [PATCH] Btrfs-progs: chunk-recover: use right size when allocating chunk root node Wang Shilong

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).