Skip to content

Commit 6b6fa7a

Browse files
steffen-maiermartinkpetersen
authored andcommitted
scsi: core: fix dh and multipathing for SCSI hosts without request batching
This was missing from scsi_device_from_queue() due to the introduction of another new scsi_mq_ops_no_commit of linux-next commit 8930a6c ("scsi: core: add support for request batching") from Martin's scsi/5.4/scsi-queue or James' scsi/misc. Only devicehandler code seems to call scsi_device_from_queue(): *** drivers/scsi/scsi_dh.c: scsi_dh_activate[255] sdev = scsi_device_from_queue(q); scsi_dh_set_params[302] sdev = scsi_device_from_queue(q); scsi_dh_attach[325] sdev = scsi_device_from_queue(q); scsi_dh_attached_handler_name[363] sdev = scsi_device_from_queue(q); Fixes multipath tools follow-on errors: $ multipath -v6 ... libdevmapper: ioctl/libdm-iface.c(1887): device-mapper: reload ioctl on mpatha failed: No such device ... mpatha: failed to load map, error 19 ... showing also as kernel messages: device-mapper: table: 252:0: multipath: error attaching hardware handler device-mapper: ioctl: error adding target to table Signed-off-by: Steffen Maier <[email protected]> Fixes: 8930a6c ("scsi: core: add support for request batching") Cc: Paolo Bonzini <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Reviewed-by: Bart Van Assche <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent 82a9ac7 commit 6b6fa7a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/scsi/scsi_lib.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1922,7 +1922,8 @@ struct scsi_device *scsi_device_from_queue(struct request_queue *q)
19221922
{
19231923
struct scsi_device *sdev = NULL;
19241924

1925-
if (q->mq_ops == &scsi_mq_ops)
1925+
if (q->mq_ops == &scsi_mq_ops_no_commit ||
1926+
q->mq_ops == &scsi_mq_ops)
19261927
sdev = q->queuedata;
19271928
if (!sdev || !get_device(&sdev->sdev_gendev))
19281929
sdev = NULL;

0 commit comments

Comments
 (0)