aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorJosef Bacik2013-02-07 15:27:28 -0600
committerGreg Kroah-Hartman2013-03-14 13:26:35 -0500
commit5cb065d3405ac7549caedccd92e7e51adce916bd (patch)
tree7c1b02c00bbd497fbf0c2280ef388317343e15b6 /fs
parent5f62c696e2fed435824de55e6ceba73abe2304bf (diff)
downloadkernel-omap-5cb065d3405ac7549caedccd92e7e51adce916bd.tar.gz
kernel-omap-5cb065d3405ac7549caedccd92e7e51adce916bd.tar.xz
kernel-omap-5cb065d3405ac7549caedccd92e7e51adce916bd.zip
Btrfs: cleanup orphan reservation if truncate fails
commit 4a7d0f6854c4a4ad1dba00a3b128a32d39b9a742 upstream. I noticed we were getting lots of warnings with xfstest 83 because we have reservations outstanding. This is because we moved the orphan add outside of the truncate, but we don't actually cleanup our reservation if something fails. This fixes the problem and I no longer see warnings. Thanks, Signed-off-by: Josef Bacik <jbacik@fusionio.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs')
-rw-r--r--fs/btrfs/inode.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 72fe40b57ae5..659ea815dbf3 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2493,6 +2493,8 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
2493 goto out; 2493 goto out;
2494 2494
2495 ret = btrfs_truncate(inode); 2495 ret = btrfs_truncate(inode);
2496 if (ret)
2497 btrfs_orphan_del(NULL, inode);
2496 } else { 2498 } else {
2497 nr_unlink++; 2499 nr_unlink++;
2498 } 2500 }