On Mon, Oct 02, 2017 at 03:56:08PM +0000, Bart Van Assche wrote: > Since queue_flag_set() and queue_flag_clear() use non-atomic primitives to > set and clear flags it is essential to protect calls of these functions with > the queue lock. Otherwise flag updates could get lost due to concurrent > queue_flag_set() or queue_flag_clear() calls. > > One of the reasons why I introduced this helper function is to keep the > wake_up_all(&q->mq_freeze_wq) call that is added to this function by a later > patch in the block layer. Oh, despite the _unlocked versions existing it doesn't do any atomic ops. Yeah, we'll need the queue lock then. But please split it into one helper for setting the queue blocked and to clear it, especially if the clear needs to do an additional wake_up.