From 857cc2fc29cfaf4ee98fe9967bbf6a3942191136 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Mon, 7 Oct 2013 15:21:08 -0400 Subject: 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 Signed-off-by: Chris Mason --- fs/btrfs/inode.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'fs/btrfs/inode.c') 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); -- cgit v1.2.1