diff options
author | Josef Bacik <josef@redhat.com> | 2011-12-09 13:26:22 -0500 |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-12-15 11:04:23 -0500 |
commit | 7041ee97281c30a78658904140c7bd9373a36142 (patch) | |
tree | 7e0426127ca6cbe1c78e3def77b85488c69193ca /fs/btrfs/inode.c | |
parent | 660d3f6cde552323578b85fc5a09a6742f1fe804 (diff) |
Btrfs: fix leaked space in truncate
We were occasionaly leaking space when running xfstest 269. This is because if
we failed to start the transaction in the truncate loop we'd just goto out, but
we need to break so that the inode is removed from the orphan list and the space
is properly freed. Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
Diffstat (limited to 'fs/btrfs/inode.c')
-rw-r--r-- | fs/btrfs/inode.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index 8938174e6bc1..6349c63a4b37 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c | |||
@@ -6566,8 +6566,9 @@ static int btrfs_truncate(struct inode *inode) | |||
6566 | /* Just need the 1 for updating the inode */ | 6566 | /* Just need the 1 for updating the inode */ |
6567 | trans = btrfs_start_transaction(root, 1); | 6567 | trans = btrfs_start_transaction(root, 1); |
6568 | if (IS_ERR(trans)) { | 6568 | if (IS_ERR(trans)) { |
6569 | err = PTR_ERR(trans); | 6569 | ret = err = PTR_ERR(trans); |
6570 | goto out; | 6570 | trans = NULL; |
6571 | break; | ||
6571 | } | 6572 | } |
6572 | } | 6573 | } |
6573 | 6574 | ||