]> git.baikalelectronics.ru Git - kernel.git/commit
scsi: core: Fix scsi_device_max_queue_depth()
authorBart Van Assche <bvanassche@acm.org>
Fri, 3 Dec 2021 23:19:34 +0000 (15:19 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 7 Dec 2021 03:30:32 +0000 (22:30 -0500)
commit78a8b9e157b64d539bde23901deeff70b59cf6e1
tree3deac6d08c8d57a4b2155ef8dc22e2c0fa6d442e
parenteddb1dd20c0e17d7f2d96bc7fe6eb115326b6dd2
scsi: core: Fix scsi_device_max_queue_depth()

The comment above scsi_device_max_queue_depth() and also the description of
commit 0b20b7f77faf ("scsi: core: Make sure sdev->queue_depth is <=
max(shost->can_queue, 1024)") contradict the implementation of the function
scsi_device_max_queue_depth(). Additionally, the maximum queue depth of a
SCSI LUN never exceeds host->can_queue. Fix scsi_device_max_queue_depth()
by changing max_t() into min_t().

Link: https://lore.kernel.org/r/20211203231950.193369-2-bvanassche@acm.org
Fixes: 0b20b7f77faf ("scsi: core: Make sure sdev->queue_depth is <= max(shost->can_queue, 1024)")
Cc: Hannes Reinecke <hare@suse.de>
Cc: Sumanesh Samanta <sumanesh.samanta@broadcom.com>
Tested-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Bean Huo <beanhuo@micron.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/scsi.c