Commit 5cb065d3 authored by Josef Bacik's avatar Josef Bacik Committed by Greg Kroah-Hartman

Btrfs: cleanup orphan reservation if truncate fails

commit 4a7d0f68 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: default avatarJosef Bacik <jbacik@fusionio.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 5f62c696
......@@ -2493,6 +2493,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++;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment