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>
This commit is contained in:
parent
5d80366e9b
commit
4a7d0f6854
|
@ -2538,6 +2538,8 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = btrfs_truncate(inode);
|
ret = btrfs_truncate(inode);
|
||||||
|
if (ret)
|
||||||
|
btrfs_orphan_del(NULL, inode);
|
||||||
} else {
|
} else {
|
||||||
nr_unlink++;
|
nr_unlink++;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue