diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c7367ae5a3e6..e40cdd5b4669 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -949,14 +949,14 @@ static int btrfs_free_dev_extent(struct btrfs_trans_handle *trans, | |||
949 | if (ret > 0) { | 949 | if (ret > 0) { |
950 | ret = btrfs_previous_item(root, path, key.objectid, | 950 | ret = btrfs_previous_item(root, path, key.objectid, |
951 | BTRFS_DEV_EXTENT_KEY); | 951 | BTRFS_DEV_EXTENT_KEY); |
952 | BUG_ON(ret); | 952 | if (ret) |
953 | goto out; | ||
953 | leaf = path->nodes[0]; | 954 | leaf = path->nodes[0]; |
954 | btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); | 955 | btrfs_item_key_to_cpu(leaf, &found_key, path->slots[0]); |
955 | extent = btrfs_item_ptr(leaf, path->slots[0], | 956 | extent = btrfs_item_ptr(leaf, path->slots[0], |
956 | struct btrfs_dev_extent); | 957 | struct btrfs_dev_extent); |
957 | BUG_ON(found_key.offset > start || found_key.offset + | 958 | BUG_ON(found_key.offset > start || found_key.offset + |
958 | btrfs_dev_extent_length(leaf, extent) < start); | 959 | btrfs_dev_extent_length(leaf, extent) < start); |
959 | ret = 0; | ||
960 | } else if (ret == 0) { | 960 | } else if (ret == 0) { |
961 | leaf = path->nodes[0]; | 961 | leaf = path->nodes[0]; |
962 | extent = btrfs_item_ptr(leaf, path->slots[0], | 962 | extent = btrfs_item_ptr(leaf, path->slots[0], |
@@ -969,6 +969,7 @@ static int btrfs_free_dev_extent(struct btrfs_trans_handle *trans, | |||
969 | ret = btrfs_del_item(trans, root, path); | 969 | ret = btrfs_del_item(trans, root, path); |
970 | BUG_ON(ret); | 970 | BUG_ON(ret); |
971 | 971 | ||
972 | out: | ||
972 | btrfs_free_path(path); | 973 | btrfs_free_path(path); |
973 | return ret; | 974 | return ret; |
974 | } | 975 | } |