summaryrefslogtreecommitdiff
path: root/fs/btrfs
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2024-08-21 15:53:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-09-04 13:24:55 +0200
commit91ca04cc39659cda6e5f5607a9be4b03fd410029 (patch)
treeef65a609e676783171b9ea87353ec8f92afa9c5f /fs/btrfs
parentb29bae47f265b124236471586549f593cd05a37e (diff)
downloadlinux-91ca04cc39659cda6e5f5607a9be4b03fd410029.tar.gz
linux-91ca04cc39659cda6e5f5607a9be4b03fd410029.tar.bz2
linux-91ca04cc39659cda6e5f5607a9be4b03fd410029.zip
btrfs: run delayed iputs when flushing delalloc
commit 2d3447261031503b181dacc549fe65ffe2d93d65 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/btrfs')
-rw-r--r--fs/btrfs/qgroup.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
index f3b066b44280..59bb9653615e 100644
--- a/fs/btrfs/qgroup.c
+++ b/fs/btrfs/qgroup.c
@@ -3745,6 +3745,8 @@ static int try_flush_qgroup(struct btrfs_root *root)
return 0;
}
+ btrfs_run_delayed_iputs(root->fs_info);
+ btrfs_wait_on_delayed_iputs(root->fs_info);
ret = btrfs_start_delalloc_snapshot(root, true);
if (ret < 0)
goto out;