diff options
-rw-r--r-- | fs/btrfs/tree-log.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c index 4ce8a9f41d1e..f3cacc079102 100644 --- a/fs/btrfs/tree-log.c +++ b/fs/btrfs/tree-log.c | |||
@@ -1617,7 +1617,8 @@ static int replay_one_buffer(struct btrfs_root *log, struct extent_buffer *eb, | |||
1617 | return 0; | 1617 | return 0; |
1618 | 1618 | ||
1619 | path = btrfs_alloc_path(); | 1619 | path = btrfs_alloc_path(); |
1620 | BUG_ON(!path); | 1620 | if (!path) |
1621 | return -ENOMEM; | ||
1621 | 1622 | ||
1622 | nritems = btrfs_header_nritems(eb); | 1623 | nritems = btrfs_header_nritems(eb); |
1623 | for (i = 0; i < nritems; i++) { | 1624 | for (i = 0; i < nritems; i++) { |
@@ -1723,7 +1724,9 @@ static noinline int walk_down_log_tree(struct btrfs_trans_handle *trans, | |||
1723 | return -ENOMEM; | 1724 | return -ENOMEM; |
1724 | 1725 | ||
1725 | if (*level == 1) { | 1726 | if (*level == 1) { |
1726 | wc->process_func(root, next, wc, ptr_gen); | 1727 | ret = wc->process_func(root, next, wc, ptr_gen); |
1728 | if (ret) | ||
1729 | return ret; | ||
1727 | 1730 | ||
1728 | path->slots[*level]++; | 1731 | path->slots[*level]++; |
1729 | if (wc->free) { | 1732 | if (wc->free) { |
@@ -1788,8 +1791,11 @@ static noinline int walk_up_log_tree(struct btrfs_trans_handle *trans, | |||
1788 | parent = path->nodes[*level + 1]; | 1791 | parent = path->nodes[*level + 1]; |
1789 | 1792 | ||
1790 | root_owner = btrfs_header_owner(parent); | 1793 | root_owner = btrfs_header_owner(parent); |
1791 | wc->process_func(root, path->nodes[*level], wc, | 1794 | ret = wc->process_func(root, path->nodes[*level], wc, |
1792 | btrfs_header_generation(path->nodes[*level])); | 1795 | btrfs_header_generation(path->nodes[*level])); |
1796 | if (ret) | ||
1797 | return ret; | ||
1798 | |||
1793 | if (wc->free) { | 1799 | if (wc->free) { |
1794 | struct extent_buffer *next; | 1800 | struct extent_buffer *next; |
1795 | 1801 | ||