diff options
author | Josef Bacik <josef@redhat.com> | 2011-12-09 18:26:22 (GMT) |
---|---|---|
committer | Josef Bacik <josef@redhat.com> | 2011-12-15 16:04:23 (GMT) |
commit | 7041ee97281c30a78658904140c7bd9373a36142 (patch) | |
tree | 7e0426127ca6cbe1c78e3def77b85488c69193ca | |
parent | 660d3f6cde552323578b85fc5a09a6742f1fe804 (diff) | |
download | linux-7041ee97281c30a78658904140c7bd9373a36142.tar.xz |
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>
-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 8938174..6349c63 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -6566,8 +6566,9 @@ static int btrfs_truncate(struct inode *inode) /* Just need the 1 for updating the inode */ trans = btrfs_start_transaction(root, 1); if (IS_ERR(trans)) { - err = PTR_ERR(trans); - goto out; + ret = err = PTR_ERR(trans); + trans = NULL; + break; } } |