Linux Btrfs filesystem development
 help / color / mirror / Atom feed
* [PATCH] btrfs: take the correct ctl lock when removing free space cache
@ 2022-08-19 19:44 Josef Bacik
  2022-08-19 20:09 ` David Sterba
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Josef Bacik @ 2022-08-19 19:44 UTC (permalink / raw)
  To: linux-btrfs, kernel-team

This is a fixup for

btrfs: call __btrfs_remove_free_space_cache_locked on cache load failure

I was taking the wrong ctl lock, this can be folded into that patch.

Signed-off-by: Josef Bacik <josef@toxicpanda.com>
---
 fs/btrfs/free-space-cache.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
index 6b70371d4918..157cd712a923 100644
--- a/fs/btrfs/free-space-cache.c
+++ b/fs/btrfs/free-space-cache.c
@@ -1035,9 +1035,9 @@ int load_free_space_cache(struct btrfs_block_group *block_group)
 		if (ret == 0)
 			ret = 1;
 	} else {
-		spin_lock(&ctl->tree_lock);
+		spin_lock(&tmp_ctl->tree_lock);
 		__btrfs_remove_free_space_cache(&tmp_ctl);
-		spin_unlock(&ctl->tree_lock);
+		spin_unlock(&tmp_ctl->tree_lock);
 		btrfs_warn(fs_info,
 			   "block group %llu has wrong amount of free space",
 			   block_group->start);
-- 
2.26.3


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-08-20  1:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-19 19:44 [PATCH] btrfs: take the correct ctl lock when removing free space cache Josef Bacik
2022-08-19 20:09 ` David Sterba
2022-08-19 23:01 ` kernel test robot
2022-08-20  1:39 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox