summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZach Brown <zab@redhat.com>2013-01-17 12:06:29 -0800
committerZach Brown <zab@redhat.com>2013-02-05 16:09:38 -0800
commitea0ac9416fd13b7e20899d8c7c130e5375171ea6 (patch)
tree32c15a293be36b815634fb95aa6846a1fc274ec1
parent52162700bb59663add809a6465ce2769d80b3664 (diff)
btrfs-progs: return error from commit_tree_roots()
Errors cow-ing the root block are silently being dropped. This is just a step towards error handling because both the caller and calee assert on errors. Signed-off-by: Zach Brown <zab@redhat.com>
-rw-r--r--disk-io.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/disk-io.c b/disk-io.c
index d3b8c518..dd06748b 100644
--- a/disk-io.c
+++ b/disk-io.c
@@ -345,14 +345,17 @@ static int commit_tree_roots(struct btrfs_trans_handle *trans,
struct btrfs_root *root;
struct list_head *next;
struct extent_buffer *eb;
+ int ret;
if (fs_info->readonly)
return 0;
eb = fs_info->tree_root->node;
extent_buffer_get(eb);
- btrfs_cow_block(trans, fs_info->tree_root, eb, NULL, 0, &eb);
+ ret = btrfs_cow_block(trans, fs_info->tree_root, eb, NULL, 0, &eb);
free_extent_buffer(eb);
+ if (ret)
+ return ret;
while(!list_empty(&fs_info->dirty_cowonly_roots)) {
next = fs_info->dirty_cowonly_roots.next;