OSDN Git Service

scsi: iscsi: Fix shost->max_id use
authorMike Christie <michael.christie@oracle.com>
Tue, 25 May 2021 18:18:07 +0000 (13:18 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Wed, 2 Jun 2021 05:28:21 +0000 (01:28 -0400)
commitbdd4aad7ff92ae39c2e93c415bb6761cb8b584da
tree29d89250f8ba8f966d9aed6c5801a1b107a20e7c
parentec29d0ac29be366450a7faffbcf8cba3a6a3b506
scsi: iscsi: Fix shost->max_id use

The iscsi offload drivers are setting the shost->max_id to the max number
of sessions they support. The problem is that max_id is not the max number
of targets but the highest identifier the targets can have. To use it to
limit the number of targets we need to set it to max sessions - 1, or we
can end up with a session we might not have preallocated resources for.

Link: https://lore.kernel.org/r/20210525181821.7617-15-michael.christie@oracle.com
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Mike Christie <michael.christie@oracle.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/be2iscsi/be_main.c
drivers/scsi/bnx2i/bnx2i_iscsi.c
drivers/scsi/cxgbi/libcxgbi.c
drivers/scsi/qedi/qedi_main.c