]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - queue-5.10/btrfs-make-btrfs_clear_delalloc_extent-free-delalloc.patch
Fixes for 5.10
[thirdparty/kernel/stable-queue.git] / queue-5.10 / btrfs-make-btrfs_clear_delalloc_extent-free-delalloc.patch
CommitLineData
dd0792fc
SL
1From 24d73837c089c17cf7057f54f6761e52a683c199 Mon Sep 17 00:00:00 2001
2From: Sasha Levin <sashal@kernel.org>
3Date: Tue, 26 Mar 2024 11:55:22 -0700
4Subject: btrfs: make btrfs_clear_delalloc_extent() free delalloc reserve
5
6From: Boris Burkov <boris@bur.io>
7
8[ Upstream commit 3c6f0c5ecc8910d4ffb0dfe85609ebc0c91c8f34 ]
9
10Currently, this call site in btrfs_clear_delalloc_extent() only converts
11the reservation. We are marking it not delalloc, so I don't think it
12makes sense to keep the rsv around. This is a path where we are not
13sure to join a transaction, so it leads to incorrect free-ing during
14umount.
15
16Helps with the pass rate of generic/269 and generic/475.
17
18Reviewed-by: Qu Wenruo <wqu@suse.com>
19Signed-off-by: Boris Burkov <boris@bur.io>
20Signed-off-by: David Sterba <dsterba@suse.com>
21Signed-off-by: Sasha Levin <sashal@kernel.org>
22---
23 fs/btrfs/inode.c | 2 +-
24 1 file changed, 1 insertion(+), 1 deletion(-)
25
26diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
27index 591caac2bf814..1f99d7dced17a 100644
28--- a/fs/btrfs/inode.c
29+++ b/fs/btrfs/inode.c
30@@ -2070,7 +2070,7 @@ void btrfs_clear_delalloc_extent(struct inode *vfs_inode,
31 */
32 if (*bits & EXTENT_CLEAR_META_RESV &&
33 root != fs_info->tree_root)
34- btrfs_delalloc_release_metadata(inode, len, false);
35+ btrfs_delalloc_release_metadata(inode, len, true);
36
37 /* For sanity tests. */
38 if (btrfs_is_testing(fs_info))
39--
402.43.0
41