]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
scsi: iscsi: Release endpoint ID when its freed
authorMike Christie <michael.christie@oracle.com>
Fri, 8 Apr 2022 00:13:07 +0000 (19:13 -0500)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 22 Jun 2022 12:22:15 +0000 (14:22 +0200)
commit9226b6fac4a4f80cd4fc96013c56557c25dd9c09
treeb71f7555949f6f38097168ea5cc964e57ae73a4b
parent7f0943669a832cc1c12dee70fff53836e130fedc
scsi: iscsi: Release endpoint ID when its freed

BugLink: https://bugs.launchpad.net/bugs/1972905
[ Upstream commit 3c6ae371b8a1ffba1fc415989fd581ebf841ed0a ]

We can't release the endpoint ID until all references to the endpoint have
been dropped or it could be allocated while in use. This has us use an idr
instead of looping over all conns to find a free ID and then free the ID
when all references have been dropped instead of when the device is only
deleted.

Link: https://lore.kernel.org/r/20220408001314.5014-4-michael.christie@oracle.com
Tested-by: Manish Rangankar <mrangankar@marvell.com>
Reviewed-by: Lee Duncan <lduncan@suse.com>
Reviewed-by: Chris Leech <cleech@redhat.com>
Reviewed-by: Wu Bo <wubo40@huawei.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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
drivers/scsi/scsi_transport_iscsi.c
include/scsi/scsi_transport_iscsi.h