diff options
author | Mike Christie <michael.christie@oracle.com> | 2021-05-25 13:18:07 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-07-20 16:10:43 +0200 |
commit | a686ea60c17a99452785d74dfbf54153099e1025 (patch) | |
tree | fa445c5d298007d069311e5177216730fb11dcca /drivers/scsi/qedi | |
parent | d04958a348e560938410e04a12fb99da9c7e6a00 (diff) | |
download | linux-stable-a686ea60c17a99452785d74dfbf54153099e1025.tar.gz linux-stable-a686ea60c17a99452785d74dfbf54153099e1025.tar.bz2 linux-stable-a686ea60c17a99452785d74dfbf54153099e1025.zip |
scsi: iscsi: Fix shost->max_id use
[ Upstream commit bdd4aad7ff92ae39c2e93c415bb6761cb8b584da ]
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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/scsi/qedi')
-rw-r--r-- | drivers/scsi/qedi/qedi_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/scsi/qedi/qedi_main.c b/drivers/scsi/qedi/qedi_main.c index 4498add3d4d6..1ec42c5f0b2a 100644 --- a/drivers/scsi/qedi/qedi_main.c +++ b/drivers/scsi/qedi/qedi_main.c @@ -631,7 +631,7 @@ static struct qedi_ctx *qedi_host_alloc(struct pci_dev *pdev) goto exit_setup_shost; } - shost->max_id = QEDI_MAX_ISCSI_CONNS_PER_HBA; + shost->max_id = QEDI_MAX_ISCSI_CONNS_PER_HBA - 1; shost->max_channel = 0; shost->max_lun = ~0; shost->max_cmd_len = 16; |