The cycle:

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

Reported-by: [email protected]
Tested-by: [email protected]
Signed-off-by: Alan Huang <[email protected]>
---
 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


Reply via email to