diff options
Diffstat (limited to 'fs/btrfs/backref.c')
-rw-r--r-- | fs/btrfs/backref.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index b9a843226de8..0436c12da8c2 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c | |||
@@ -297,7 +297,7 @@ static int __add_delayed_refs(struct btrfs_delayed_ref_head *head, u64 seq, | |||
297 | struct btrfs_delayed_extent_op *extent_op = head->extent_op; | 297 | struct btrfs_delayed_extent_op *extent_op = head->extent_op; |
298 | struct rb_node *n = &head->node.rb_node; | 298 | struct rb_node *n = &head->node.rb_node; |
299 | int sgn; | 299 | int sgn; |
300 | int ret; | 300 | int ret = 0; |
301 | 301 | ||
302 | if (extent_op && extent_op->update_key) | 302 | if (extent_op && extent_op->update_key) |
303 | btrfs_disk_key_to_cpu(info_key, &extent_op->key); | 303 | btrfs_disk_key_to_cpu(info_key, &extent_op->key); |
@@ -392,7 +392,7 @@ static int __add_inline_refs(struct btrfs_fs_info *fs_info, | |||
392 | struct btrfs_key *info_key, int *info_level, | 392 | struct btrfs_key *info_key, int *info_level, |
393 | struct list_head *prefs) | 393 | struct list_head *prefs) |
394 | { | 394 | { |
395 | int ret; | 395 | int ret = 0; |
396 | int slot; | 396 | int slot; |
397 | struct extent_buffer *leaf; | 397 | struct extent_buffer *leaf; |
398 | struct btrfs_key key; | 398 | struct btrfs_key key; |
@@ -583,7 +583,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans, | |||
583 | struct btrfs_path *path; | 583 | struct btrfs_path *path; |
584 | struct btrfs_key info_key = { 0 }; | 584 | struct btrfs_key info_key = { 0 }; |
585 | struct btrfs_delayed_ref_root *delayed_refs = NULL; | 585 | struct btrfs_delayed_ref_root *delayed_refs = NULL; |
586 | struct btrfs_delayed_ref_head *head = NULL; | 586 | struct btrfs_delayed_ref_head *head; |
587 | int info_level = 0; | 587 | int info_level = 0; |
588 | int ret; | 588 | int ret; |
589 | struct list_head prefs_delayed; | 589 | struct list_head prefs_delayed; |
@@ -607,6 +607,8 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans, | |||
607 | * at a specified point in time | 607 | * at a specified point in time |
608 | */ | 608 | */ |
609 | again: | 609 | again: |
610 | head = NULL; | ||
611 | |||
610 | ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0); | 612 | ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0); |
611 | if (ret < 0) | 613 | if (ret < 0) |
612 | goto out; | 614 | goto out; |
@@ -635,8 +637,10 @@ again: | |||
635 | goto again; | 637 | goto again; |
636 | } | 638 | } |
637 | ret = __add_delayed_refs(head, seq, &info_key, &prefs_delayed); | 639 | ret = __add_delayed_refs(head, seq, &info_key, &prefs_delayed); |
638 | if (ret) | 640 | if (ret) { |
641 | spin_unlock(&delayed_refs->lock); | ||
639 | goto out; | 642 | goto out; |
643 | } | ||
640 | } | 644 | } |
641 | spin_unlock(&delayed_refs->lock); | 645 | spin_unlock(&delayed_refs->lock); |
642 | 646 | ||
@@ -892,6 +896,8 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path, | |||
892 | if (eb != eb_in) | 896 | if (eb != eb_in) |
893 | free_extent_buffer(eb); | 897 | free_extent_buffer(eb); |
894 | ret = inode_ref_info(parent, 0, fs_root, path, &found_key); | 898 | ret = inode_ref_info(parent, 0, fs_root, path, &found_key); |
899 | if (ret > 0) | ||
900 | ret = -ENOENT; | ||
895 | if (ret) | 901 | if (ret) |
896 | break; | 902 | break; |
897 | next_inum = found_key.offset; | 903 | next_inum = found_key.offset; |