Thread (3 messages) 3 messages, 3 authors, 2021-10-12

Re: [PATCH v3] scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma()

From: John Garry <hidden>
Date: 2021-10-08 11:58:02
Also in: linux-scsi, lkml, stable

On 08/10/2021 05:35, Dexuan Cui wrote:
After commit ea2f0f77538c, a 416-CPU VM running on Hyper-V hangs during
boot because the hv_storvsc driver sets scsi_driver.can_queue to an "int"
value that exceeds SHRT_MAX, and hence scsi_add_host_with_dma() sets
shost->cmd_per_lun to a negative "short" value.

Use min_t(int, ...) to fix the issue.

Fixes: ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at can_queue")
Cc:stable@vger.kernel.org
Signed-off-by: Dexuan Cui<decui@microsoft.com>
Reviewed-by: Haiyang Zhang<haiyangz@microsoft.com>
Reviewed-by: Ming Lei<redacted>
Reviewed-by: John Garry <redacted>

thanks
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help