public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 0/3] blk-mq: allow to run queue if queue refcount is held
@ 2019-04-01  4:42 Ming Lei
  2019-04-01  4:42 ` [PATCH V2 1/3] blk-mq: free hw queue's resource in hctx's release handler Ming Lei
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Ming Lei @ 2019-04-01  4:42 UTC (permalink / raw)
  To: Jens Axboe
  Cc: linux-block, Ming Lei, Dongli Zhang, James Smart, Bart Van Assche,
	linux-scsi, Martin K . Petersen, Christoph Hellwig,
	James E . J . Bottomley, jianchao wang

Hi,

Since 45a9c9d909b2 ("blk-mq: Fix a use-after-free"), run queue isn't
allowed during cleanup queue even though queue refcount is held.

This change has caused lots of kernel oops triggered in run queue path,
turns out it isn't easy to fix them all.

So move freeing of hw queue resources into hctx's release handler, then
the above issue is fixed. Meantime, this way is safe given freeing hw
queue resource doesn't require tags.


V2:
	- moving freeing hw queue resources into hctx's release handler


Ming Lei (3):
  blk-mq: free hw queue's resource in hctx's release handler
  block: don't drain in-progress dispatch in blk_cleanup_queue()
  SCSI: don't grab queue usage counter before run queue

 block/blk-core.c        | 14 +-------------
 block/blk-mq-sysfs.c    |  6 ++++++
 block/blk-mq.c          |  8 ++------
 block/blk-mq.h          |  2 +-
 drivers/scsi/scsi_lib.c |  7 -------
 5 files changed, 10 insertions(+), 27 deletions(-)

Cc: Dongli Zhang <dongli.zhang@oracle.com>
Cc: James Smart <james.smart@broadcom.com>
Cc: Bart Van Assche <bart.vanassche@wdc.com>
Cc: linux-scsi@vger.kernel.org,
Cc: Martin K . Petersen <martin.petersen@oracle.com>,
Cc: Christoph Hellwig <hch@lst.de>,
Cc: James E . J . Bottomley <jejb@linux.vnet.ibm.com>,
Cc: jianchao wang <jianchao.w.wang@oracle.com>

-- 
2.9.5


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

end of thread, other threads:[~2019-04-02  0:38 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-01  4:42 [PATCH V2 0/3] blk-mq: allow to run queue if queue refcount is held Ming Lei
2019-04-01  4:42 ` [PATCH V2 1/3] blk-mq: free hw queue's resource in hctx's release handler Ming Lei
2019-04-01  4:42 ` [PATCH V2 2/3] block: don't drain in-progress dispatch in blk_cleanup_queue() Ming Lei
2019-04-01 15:14   ` Bart Van Assche
2019-04-02  0:38     ` Ming Lei
2019-04-01  4:42 ` [PATCH V2 3/3] SCSI: don't grab queue usage counter before run queue Ming Lei

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