1
0
Fork 0
alistair23-linux/include
Ming Lei 226b4fc75c blk-mq: add callback of .cleanup_rq
SCSI maintains its own driver private data hooked off of each SCSI
request, and the pridate data won't be freed after scsi_queue_rq()
returns BLK_STS_RESOURCE or BLK_STS_DEV_RESOURCE. An upper layer driver
(e.g. dm-rq) may need to retry these SCSI requests, before SCSI has
fully dispatched them, due to a lower level SCSI driver's resource
limitation identified in scsi_queue_rq(). Currently SCSI's per-request
private data is leaked when the upper layer driver (dm-rq) frees and
then retries these requests in response to BLK_STS_RESOURCE or
BLK_STS_DEV_RESOURCE returns from scsi_queue_rq().

This usecase is so specialized that it doesn't warrant training an
existing blk-mq interface (e.g. blk_mq_free_request) to allow SCSI to
account for freeing its driver private data -- doing so would add an
extra branch for handling a special case that all other consumers of
SCSI (and blk-mq) won't ever need to worry about.

So the most pragmatic way forward is to delegate freeing SCSI driver
private data to the upper layer driver (dm-rq).  Do so by adding
new .cleanup_rq callback and calling a new blk_mq_cleanup_rq() method
from dm-rq.  A following commit will implement the .cleanup_rq() hook
in scsi_mq_ops.

Cc: Ewan D. Milne <emilne@redhat.com>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Snitzer <snitzer@redhat.com>
Cc: dm-devel@redhat.com
Cc: <stable@vger.kernel.org>
Fixes: 396eaf21ee ("blk-mq: improve DM's blk-mq IO merging via blk_insert_cloned_request feedback")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
2019-08-04 21:42:06 -06:00
..
acpi It's been a relatively busy cycle for docs: 2019-07-09 12:34:26 -07:00
asm-generic asm-generic: fix -Wtype-limits compiler warnings 2019-08-03 07:02:01 -07:00
clocksource clocksource/drivers: Continue making Hyper-V clocksource ISA agnostic 2019-07-03 11:00:59 +02:00
crypto Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2019-07-08 20:57:08 -07:00
drm drm/fb-helper: Instanciate shadow FB if configured in device's mode_config 2019-08-01 15:01:35 +02:00
dt-bindings ARM: Device-tree updates 2019-07-19 17:19:24 -07:00
keys request_key improvements 2019-07-08 19:19:37 -07:00
kvm KVM: arm/arm64: Support chained PMU counters 2019-07-05 13:56:22 +01:00
linux blk-mq: add callback of .cleanup_rq 2019-08-04 21:42:06 -06:00
math-emu
media media updates for v5.3-rc1 2019-07-09 09:47:22 -07:00
misc powerpc updates for 5.3 2019-07-13 16:08:36 -07:00
net tcp: be more careful in tcp_fragment() 2019-07-21 20:41:24 -07:00
pcmcia It's been a relatively busy cycle for docs: 2019-07-09 12:34:26 -07:00
ras
rdma RDMA/devices: Remove the lock around remove_client_context 2019-08-01 11:44:48 -04:00
scsi scsi: fcoe: Embed fc_rport_priv in fcoe_rport structure 2019-07-29 21:12:35 -04:00
soc Merge branch 'pdf_fixes_v1' of https://git.linuxtv.org/mchehab/experimental into mauro 2019-07-22 13:51:20 -06:00
sound SPDX fixes for 5.3-rc2 2019-07-28 10:00:06 -07:00
target
trace tracing: Fix header include guards in trace event headers 2019-07-30 21:49:06 -04:00
uapi virtio, vhost: bugfixes 2019-07-29 11:34:12 -07:00
vdso vdso: Remove superfluous #ifdef __KERNEL__ in vdso/datapage.h 2019-06-26 07:28:09 +02:00
video drm main pull request for v5.3-rc1 (sans mm changes) 2019-07-15 19:04:27 -07:00
xen xen: avoid link error on ARM 2019-07-31 08:14:12 +02:00
Kbuild kbuild: add net/netfilter/nf_tables_offload.h to header-test blacklist. 2019-07-21 11:43:43 -07:00