]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commit
scsi: target: iscsi: Make sure the np under each tpg is unique
authorZouMingzhe <mingzhe.zou@easystack.cn>
Tue, 11 Jan 2022 05:47:42 +0000 (13:47 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Thu, 14 Apr 2022 09:31:59 +0000 (11:31 +0200)
commit4887bd0ad994b681b111ce0f7e89010c0f130b9e
treed615cca09f1de3b55f4587ec1f5bd3c4d480107c
parente4b97bffc86153464193a93ce0224fe1d14983f0
scsi: target: iscsi: Make sure the np under each tpg is unique

BugLink: https://bugs.launchpad.net/bugs/1966118
[ Upstream commit a861790afaa8b6369eee8a88c5d5d73f5799c0c6 ]

iscsit_tpg_check_network_portal() has nested for_each loops and is supposed
to return true when a match is found. However, the tpg loop will still
continue after existing the tpg_np loop. If this tpg_np is not the last the
match value will be changed.

Break the outer loop after finding a match and make sure the np under each
tpg is unique.

Link: https://lore.kernel.org/r/20220111054742.19582-1-mingzhe.zou@easystack.cn
Signed-off-by: ZouMingzhe <mingzhe.zou@easystack.cn>
Reviewed-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: Stefan Bader <stefan.bader@canonical.com>
drivers/target/iscsi/iscsi_target_tpg.c