Skip to content

Commit 2d34472

Browse files
josefbacikkdave
authored andcommitted
btrfs: run delayed iputs when flushing delalloc
We have transient failures with btrfs/301, specifically in the part where we do for i in $(seq 0 10); do write 50m to file rm -f file done Sometimes this will result in a transient quota error, and it's because sometimes we start writeback on the file which results in a delayed iput, and thus the rm doesn't actually clean the file up. When we're flushing the quota space we need to run the delayed iputs to make sure all the unlinks that we think have completed have actually completed. This removes the small window where we could fail to find enough space in our quota. CC: stable@vger.kernel.org # 5.15+ Reviewed-by: Qu Wenruo <wqu@suse.com> Signed-off-by: Josef Bacik <josef@toxicpanda.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 534f7ef commit 2d34472

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/btrfs/qgroup.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4185,6 +4185,8 @@ static int try_flush_qgroup(struct btrfs_root *root)
41854185
return 0;
41864186
}
41874187

4188+
btrfs_run_delayed_iputs(root->fs_info);
4189+
btrfs_wait_on_delayed_iputs(root->fs_info);
41884190
ret = btrfs_start_delalloc_snapshot(root, true);
41894191
if (ret < 0)
41904192
goto out;

0 commit comments

Comments
 (0)