summaryrefslogtreecommitdiffstats
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJeff Mahoney <jeffm@suse.com>2011-10-03 23:22:41 -0400
committerDavid Sterba <dsterba@suse.cz>2012-03-21 20:45:36 -0400
commit2c536799f1bde905bbacf7af3aa6be3f4de66005 (patch)
tree54f306bf4320d97e73f9728268a99910b234d048 /fs/btrfs
parent3fbe5c02ae5a59053d779392b9a12aa8f6d6198e (diff)
btrfs: btrfs_drop_snapshot should return int
Commit cb1b69f4 (Btrfs: forced readonly when btrfs_drop_snapshot() fails) made btrfs_drop_snapshot return void because there were no callers checking the return value. That is the wrong order to handle error propogation since the caller will have no idea that an error has occured and continue on as if nothing went wrong. Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/ctree.h6
-rw-r--r--fs/btrfs/extent-tree.c4
-rw-r--r--fs/btrfs/relocation.c3
-rw-r--r--fs/btrfs/transaction.c7
4 files changed, 12 insertions, 8 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index 30c5a247ab2b..f6bca05a4b4c 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -2661,9 +2661,9 @@ static inline int btrfs_next_item(struct btrfs_root *root, struct btrfs_path *p)
2661} 2661}
2662int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path); 2662int btrfs_prev_leaf(struct btrfs_root *root, struct btrfs_path *path);
2663int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf); 2663int btrfs_leaf_free_space(struct btrfs_root *root, struct extent_buffer *leaf);
2664void btrfs_drop_snapshot(struct btrfs_root *root, 2664int __must_check btrfs_drop_snapshot(struct btrfs_root *root,
2665 struct btrfs_block_rsv *block_rsv, int update_ref, 2665 struct btrfs_block_rsv *block_rsv,
2666 int for_reloc); 2666 int update_ref, int for_reloc);
2667int btrfs_drop_subtree(struct btrfs_trans_handle *trans, 2667int btrfs_drop_subtree(struct btrfs_trans_handle *trans,
2668 struct btrfs_root *root, 2668 struct btrfs_root *root,
2669 struct extent_buffer *node, 2669 struct extent_buffer *node,
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 0daa1df16439..cd6f8ae0a78d 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -6734,7 +6734,7 @@ static noinline int walk_up_tree(struct btrfs_trans_handle *trans,
6734 * also make sure backrefs for the shared block and all lower level 6734 * also make sure backrefs for the shared block and all lower level
6735 * blocks are properly updated. 6735 * blocks are properly updated.
6736 */ 6736 */
6737void btrfs_drop_snapshot(struct btrfs_root *root, 6737int btrfs_drop_snapshot(struct btrfs_root *root,
6738 struct btrfs_block_rsv *block_rsv, int update_ref, 6738 struct btrfs_block_rsv *block_rsv, int update_ref,
6739 int for_reloc) 6739 int for_reloc)
6740{ 6740{
@@ -6902,7 +6902,7 @@ out_free:
6902out: 6902out:
6903 if (err) 6903 if (err)
6904 btrfs_std_error(root->fs_info, err); 6904 btrfs_std_error(root->fs_info, err);
6905 return; 6905 return err;
6906} 6906}
6907 6907
6908/* 6908/*
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
index 5e89a5ea692f..a87678ead611 100644
--- a/fs/btrfs/relocation.c
+++ b/fs/btrfs/relocation.c
@@ -2272,7 +2272,8 @@ again:
2272 } else { 2272 } else {
2273 list_del_init(&reloc_root->root_list); 2273 list_del_init(&reloc_root->root_list);
2274 } 2274 }
2275 btrfs_drop_snapshot(reloc_root, rc->block_rsv, 0, 1); 2275 ret = btrfs_drop_snapshot(reloc_root, rc->block_rsv, 0, 1);
2276 BUG_ON(ret < 0);
2276 } 2277 }
2277 2278
2278 if (found) { 2279 if (found) {
diff --git a/fs/btrfs/transaction.c b/fs/btrfs/transaction.c
index 6e256d90fd2f..fb5cd5a4adba 100644
--- a/fs/btrfs/transaction.c
+++ b/fs/btrfs/transaction.c
@@ -1387,6 +1387,8 @@ int btrfs_clean_old_snapshots(struct btrfs_root *root)
1387 spin_unlock(&fs_info->trans_lock); 1387 spin_unlock(&fs_info->trans_lock);
1388 1388
1389 while (!list_empty(&list)) { 1389 while (!list_empty(&list)) {
1390 int ret;
1391
1390 root = list_entry(list.next, struct btrfs_root, root_list); 1392 root = list_entry(list.next, struct btrfs_root, root_list);
1391 list_del(&root->root_list); 1393 list_del(&root->root_list);
1392 1394
@@ -1394,9 +1396,10 @@ int btrfs_clean_old_snapshots(struct btrfs_root *root)
1394 1396
1395 if (btrfs_header_backref_rev(root->node) < 1397 if (btrfs_header_backref_rev(root->node) <
1396 BTRFS_MIXED_BACKREF_REV) 1398 BTRFS_MIXED_BACKREF_REV)
1397 btrfs_drop_snapshot(root, NULL, 0, 0); 1399 ret = btrfs_drop_snapshot(root, NULL, 0, 0);
1398 else 1400 else
1399 btrfs_drop_snapshot(root, NULL, 1, 0); 1401 ret =btrfs_drop_snapshot(root, NULL, 1, 0);
1402 BUG_ON(ret < 0);
1400 } 1403 }
1401 return 0; 1404 return 0;
1402} 1405}