summaryrefslogtreecommitdiff
path: root/chunk-recover.c
diff options
context:
space:
mode:
authorWang Shilong <wangsl.fnst@cn.fujitsu.com>2013-11-27 22:43:56 +0800
committerChris Mason <clm@fb.com>2014-01-31 08:22:06 -0800
commite5f72de944385aec1863842f46dd0286801b7faa (patch)
tree3ddce801790e952b0a03b45b6b157fa3e5761c5b /chunk-recover.c
parent7ff512ce38a266756442ddca328090fe9b6781dc (diff)
Btrfs-progs: chunk-recover: use right size when allocating chunk root node
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> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'chunk-recover.c')
-rw-r--r--chunk-recover.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/chunk-recover.c b/chunk-recover.c
index 44e8b833..e880bbc8 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);