diff options
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/volumes.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c index c4ea7d8bea0f..281ff354f64f 100644 --- a/fs/btrfs/volumes.c +++ b/fs/btrfs/volumes.c | |||
@@ -1075,7 +1075,8 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | |||
1075 | key.type = BTRFS_DEV_EXTENT_KEY; | 1075 | key.type = BTRFS_DEV_EXTENT_KEY; |
1076 | ret = btrfs_insert_empty_item(trans, root, path, &key, | 1076 | ret = btrfs_insert_empty_item(trans, root, path, &key, |
1077 | sizeof(*extent)); | 1077 | sizeof(*extent)); |
1078 | BUG_ON(ret); | 1078 | if (ret) |
1079 | goto out; | ||
1079 | 1080 | ||
1080 | leaf = path->nodes[0]; | 1081 | leaf = path->nodes[0]; |
1081 | extent = btrfs_item_ptr(leaf, path->slots[0], | 1082 | extent = btrfs_item_ptr(leaf, path->slots[0], |
@@ -1090,6 +1091,7 @@ int btrfs_alloc_dev_extent(struct btrfs_trans_handle *trans, | |||
1090 | 1091 | ||
1091 | btrfs_set_dev_extent_length(leaf, extent, num_bytes); | 1092 | btrfs_set_dev_extent_length(leaf, extent, num_bytes); |
1092 | btrfs_mark_buffer_dirty(leaf); | 1093 | btrfs_mark_buffer_dirty(leaf); |
1094 | out: | ||
1093 | btrfs_free_path(path); | 1095 | btrfs_free_path(path); |
1094 | return ret; | 1096 | return ret; |
1095 | } | 1097 | } |