]> git.baikalelectronics.ru Git - 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)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 25 Jan 2022 04:30:24 +0000 (23:30 -0500)
commit9abdc9c61a8f2856a1f5715de8f3362413f74d44
tree38160df95c5b34b56d6f8b28c77c9254e4d9d73d
parent5bbd218c75983642de33af03b2494252af059b1b
scsi: target: iscsi: Make sure the np under each tpg is unique

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>
drivers/target/iscsi/iscsi_target_tpg.c