diff options
author | Dexuan Cui <[email protected]> | 2021-10-07 21:35:46 -0700 |
---|---|---|
committer | Martin K. Petersen <[email protected]> | 2021-10-12 12:37:15 -0400 |
commit | 50b6cb3516365cb69753b006be2b61c966b70588 (patch) | |
tree | 52166e9ebb497f953138b8af2906da363ad7b98a /lib/test_overflow.c | |
parent | 258aad75c62146453d03028a44f2f1590d58e1f6 (diff) |
scsi: core: Fix shost->cmd_per_lun calculation in scsi_add_host_with_dma()
After commit ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at
can_queue"), a 416-CPU VM running on Hyper-V hangs during boot because the
hv_storvsc driver sets scsi_driver.can_queue to an integer 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 work around the issue.
Link: https://lore.kernel.org/r/[email protected]
Fixes: ea2f0f77538c ("scsi: core: Cap scsi_host cmd_per_lun at can_queue")
Cc: [email protected]
Reviewed-by: Haiyang Zhang <[email protected]>
Reviewed-by: Ming Lei <[email protected]>
Reviewed-by: John Garry <[email protected]>
Signed-off-by: Dexuan Cui <[email protected]>
Signed-off-by: Martin K. Petersen <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions