public inbox for linux-bcachefs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] bcachefs: Use alloc_percpu_gfp to avoid deadlock
@ 2025-02-12 10:06 Alan Huang
  2025-02-12 14:27 ` Kent Overstreet
  0 siblings, 1 reply; 10+ messages in thread
From: Alan Huang @ 2025-02-12 10:06 UTC (permalink / raw)
  To: kent.overstreet; +Cc: linux-bcachefs, Alan Huang, syzbot+fe63f377148a6371a9db

The cycle:

CPU0:			CPU1:
bc->lock		pcpu_alloc_mutex
pcpu_alloc_mutex	bc->lock

Reported-by: syzbot+fe63f377148a6371a9db@syzkaller.appspotmail.com
Tested-by: syzbot+fe63f377148a6371a9db@syzkaller.appspotmail.com
Signed-off-by: Alan Huang <mmpgouride@gmail.com>
---
 fs/bcachefs/six.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/bcachefs/six.c b/fs/bcachefs/six.c
index 7e7c66a1e1a6..ccdc6d496910 100644
--- a/fs/bcachefs/six.c
+++ b/fs/bcachefs/six.c
@@ -873,7 +873,7 @@ void __six_lock_init(struct six_lock *lock, const char *name,
 		 * failure if they wish by checking lock->readers, but generally
 		 * will not want to treat it as an error.
 		 */
-		lock->readers = alloc_percpu(unsigned);
+		lock->readers = alloc_percpu_gfp(unsigned, GFP_NOWAIT|__GFP_NOWARN);
 	}
 #endif
 }
-- 
2.47.0


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

end of thread, other threads:[~2025-02-21 19:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-12 10:06 [PATCH] bcachefs: Use alloc_percpu_gfp to avoid deadlock Alan Huang
2025-02-12 14:27 ` Kent Overstreet
2025-02-20 10:57   ` Alan Huang
2025-02-20 12:40     ` Kent Overstreet
2025-02-20 12:44       ` Alan Huang
2025-02-20 17:16     ` Vlastimil Babka
2025-02-20 20:37       ` Kent Overstreet
2025-02-21  2:46         ` Dennis Zhou
2025-02-21  7:21           ` Vlastimil Babka
2025-02-21 19:44           ` Alan Huang

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