diff options
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r-- | fs/btrfs/extent-tree.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index a80b97100d90..15116585e714 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c | |||
@@ -3139,9 +3139,11 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans, | |||
3139 | struct extent_buffer *leaf; | 3139 | struct extent_buffer *leaf; |
3140 | 3140 | ||
3141 | ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1); | 3141 | ret = btrfs_search_slot(trans, extent_root, &cache->key, path, 0, 1); |
3142 | if (ret < 0) | 3142 | if (ret) { |
3143 | if (ret > 0) | ||
3144 | ret = -ENOENT; | ||
3143 | goto fail; | 3145 | goto fail; |
3144 | BUG_ON(ret); /* Corruption */ | 3146 | } |
3145 | 3147 | ||
3146 | leaf = path->nodes[0]; | 3148 | leaf = path->nodes[0]; |
3147 | bi = btrfs_item_ptr_offset(leaf, path->slots[0]); | 3149 | bi = btrfs_item_ptr_offset(leaf, path->slots[0]); |
@@ -3149,11 +3151,9 @@ static int write_one_cache_group(struct btrfs_trans_handle *trans, | |||
3149 | btrfs_mark_buffer_dirty(leaf); | 3151 | btrfs_mark_buffer_dirty(leaf); |
3150 | btrfs_release_path(path); | 3152 | btrfs_release_path(path); |
3151 | fail: | 3153 | fail: |
3152 | if (ret) { | 3154 | if (ret) |
3153 | btrfs_abort_transaction(trans, root, ret); | 3155 | btrfs_abort_transaction(trans, root, ret); |
3154 | return ret; | 3156 | return ret; |
3155 | } | ||
3156 | return 0; | ||
3157 | 3157 | ||
3158 | } | 3158 | } |
3159 | 3159 | ||