Skip to content

Commit 4a7d0f6

Browse files
author
Josef Bacik
committed
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 <[email protected]>
1 parent 5d80366 commit 4a7d0f6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/btrfs/inode.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,6 +2538,8 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
25382538
goto out;
25392539

25402540
ret = btrfs_truncate(inode);
2541+
if (ret)
2542+
btrfs_orphan_del(NULL, inode);
25412543
} else {
25422544
nr_unlink++;
25432545
}

0 commit comments

Comments
 (0)