aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/inode.c
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-02-07 16:27:28 -0500
committerJosef Bacik <jbacik@fusionio.com>2013-02-20 12:59:44 -0500
commit4a7d0f6854c4a4ad1dba00a3b128a32d39b9a742 (patch)
tree4c190e5f2a5ad42984c01de4c0649ae44f7f773d /fs/btrfs/inode.c
parent5d80366e9b5e56b3ffc1923b4995e83bbbf605e3 (diff)
Btrfs: cleanup orphan reservation if truncate fails
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>
Diffstat (limited to 'fs/btrfs/inode.c')
-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 cf26778085e0..16925807a9ed 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2538,6 +2538,8 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
2538 goto out; 2538 goto out;
2539 2539
2540 ret = btrfs_truncate(inode); 2540 ret = btrfs_truncate(inode);
2541 if (ret)
2542 btrfs_orphan_del(NULL, inode);
2541 } else { 2543 } else {
2542 nr_unlink++; 2544 nr_unlink++;
2543 } 2545 }