For make_btrfs(), it's setting wrong buf size for last super block write
out.
The superblock size is always BTRFS_SUPER_INFO_SIZE, not
cfg->sectorsize.
And this makes mkfs.btrfs -f -s 8K fails.
Fix it to BTRFS_SUPER_INFO_SIZE.
Signed-off-by: Qu Wenruo <quwenruo@xxxxxxxxxxxxxx>
---
Thanks goodness, this time it's not my super block checksum patches
causing bugs.
---
utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/utils.c b/utils.c
index 60235d8..00355a2 100644
--- a/utils.c
+++ b/utils.c
@@ -554,7 +554,7 @@ int make_btrfs(int fd, struct btrfs_mkfs_config *cfg)
BUG_ON(sizeof(super) > cfg->sectorsize);
memset(buf->data, 0, cfg->sectorsize);
memcpy(buf->data, &super, sizeof(super));
- buf->len = cfg->sectorsize;
+ buf->len = BTRFS_SUPER_INFO_SIZE;
csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0);
ret = pwrite(fd, buf->data, cfg->sectorsize, cfg->blocks[0]);
if (ret != cfg->sectorsize) {
--
2.6.2
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html