Re: [PATCH] bcache: Fix a sleep-in-atomic bug

2017-05-31 Thread Jia-Ju Bai
On 05/31/2017 03:23 PM, Jia-Ju Bai wrote: The driver may sleep under a spin lock, and the function call path is: journal_wait_for_write (acquire the lock by spin_lock) closure_sync schedule --> may sleep To fix it, the lock is released before "closure_sync", and the lock is acquired aga

Re: [PATCH] bcache: Fix a sleep-in-atomic bug

2017-05-31 Thread Kent Overstreet
On Wed, May 31, 2017 at 03:23:40PM +0800, Jia-Ju Bai wrote: > The driver may sleep under a spin lock, and the function call path is: > journal_wait_for_write (acquire the lock by spin_lock) > closure_sync > schedule --> may sleep This patch is incorrect, you've introduced a double unlock. D

[PATCH] bcache: Fix a sleep-in-atomic bug

2017-05-31 Thread Jia-Ju Bai
The driver may sleep under a spin lock, and the function call path is: journal_wait_for_write (acquire the lock by spin_lock) closure_sync schedule --> may sleep To fix it, the lock is released before "closure_sync", and the lock is acquired again after this function. Signed-off-by: Jia-Ju