Btrfs: free reserved space on error in a few places
While trying to track down a reserved space leak I noticed a few places where we won't properly clean up reserved space if we have an error, this patch fixes those up. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
This commit is contained in:
@@ -8498,6 +8498,8 @@ static int __btrfs_prealloc_file_range(struct inode *inode, int mode,
|
||||
ins.offset, 0, 0, 0,
|
||||
BTRFS_FILE_EXTENT_PREALLOC);
|
||||
if (ret) {
|
||||
btrfs_free_reserved_extent(root, ins.objectid,
|
||||
ins.offset);
|
||||
btrfs_abort_transaction(trans, root, ret);
|
||||
if (own_trans)
|
||||
btrfs_end_transaction(trans, root);
|
||||
|
Reference in New Issue
Block a user