diff options
-rw-r--r-- | utils.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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, |