On 4/17/19 5:44 AM, Ming Lei wrote:
With holding queue's kobject refcount, it is safe for driver to schedule requeue. However, blk_mq_kick_requeue_list() may be called after blk_sync_queue() is done because of concurrent requeue activities, then requeue work may not be completed when freeing queue, and kernel oops is triggered. So moving the cancel of requeue_work into blk_mq_release() for avoiding race between requeue and freeing queue. Cc: Dongli Zhang <dongli.zhang@xxxxxxxxxx> Cc: James Smart <james.smart@xxxxxxxxxxxx> Cc: Bart Van Assche <bart.vanassche@xxxxxxx> Cc: linux-scsi@xxxxxxxxxxxxxxx, Cc: Martin K . Petersen <martin.petersen@xxxxxxxxxx>, Cc: Christoph Hellwig <hch@xxxxxx>, Cc: James E . J . Bottomley <jejb@xxxxxxxxxxxxxxxxxx>, Cc: jianchao wang <jianchao.w.wang@xxxxxxxxxx> Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx> Reviewed-by: Johannes Thumshirn <jthumshirn@xxxxxxx> Signed-off-by: Ming Lei <ming.lei@xxxxxxxxxx> --- block/blk-core.c | 1 - block/blk-mq.c | 2 ++ 2 files changed, 2 insertions(+), 1 deletion(-)
Reviewed-by: Hannes Reinecke <hare@xxxxxxxx> Cheers, Hannes -- Dr. Hannes Reinecke Teamlead Storage & Networking hare@xxxxxxx +49 911 74053 688 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 21284 (AG Nürnberg)