Skip to content

Commit

Permalink
Btrfs: cleanup orphan reservation if truncate fails
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josef Bacik committed Feb 20, 2013
1 parent 5d80366 commit 4a7d0f6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/btrfs/inode.c
Original file line number Diff line number Diff line change
Expand Up @@ -2538,6 +2538,8 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
goto out;

ret = btrfs_truncate(inode);
if (ret)
btrfs_orphan_del(NULL, inode);
} else {
nr_unlink++;
}
Expand Down

0 comments on commit 4a7d0f6

Please sign in to comment.