summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--utils.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/utils.c b/utils.c
index ced85aaa..3676c8c3 100644
--- a/utils.c
+++ b/utils.c
@@ -346,6 +346,7 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_header_nritems(buf, nritems);
csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0);
ret = pwrite(fd, buf->data, leafsize, blocks[3]);
+ BUG_ON(ret != leafsize);
/* create the device tree */
memset(buf->data+sizeof(struct btrfs_header), 0,
@@ -381,6 +382,7 @@ int make_btrfs(int fd, const char *device, const char *label,
btrfs_set_header_nritems(buf, nritems);
csum_tree_block_size(buf, BTRFS_CRC32_SIZE, 0);
ret = pwrite(fd, buf->data, leafsize, blocks[4]);
+ BUG_ON(ret != leafsize);
/* create the FS root */
memset(buf->data+sizeof(struct btrfs_header), 0,