diff options
author | Josef Bacik <jbacik@fusionio.com> | 2013-10-07 15:21:08 -0400 |
---|---|---|
committer | Chris Mason <chris.mason@fusionio.com> | 2013-11-11 21:56:41 -0500 |
commit | 857cc2fc29cfaf4ee98fe9967bbf6a3942191136 (patch) | |
tree | ae0ba49149643241d5ae8b85e08f7c2dacb04ef8 /fs/btrfs/inode.c | |
parent | 0be5dc67c445230b0889dba63defba9a9e5561b4 (diff) | |
download | talos-op-linux-857cc2fc29cfaf4ee98fe9967bbf6a3942191136.tar.gz talos-op-linux-857cc2fc29cfaf4ee98fe9967bbf6a3942191136.zip |
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index bb242f2fb51e..bba7f1a5e9f3 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -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); |