From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: ZouMingzhe <mingzhe.zou@easystack.cn>,
Mike Christie <michael.christie@oracle.com>,
"Martin K . Petersen" <martin.petersen@oracle.com>,
Sasha Levin <sashal@kernel.org>,
linux-scsi@vger.kernel.org, target-devel@vger.kernel.org
Subject: [PATCH AUTOSEL 5.16 26/52] scsi: target: iscsi: Make sure the np under each tpg is unique
Date: Thu, 3 Feb 2022 15:29:20 -0500 [thread overview]
Message-ID: <20220203202947.2304-26-sashal@kernel.org> (raw)
In-Reply-To: <20220203202947.2304-1-sashal@kernel.org>
From: ZouMingzhe <mingzhe.zou@easystack.cn>
[ 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>
---
drivers/target/iscsi/iscsi_target_tpg.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c
index 8075f60fd02c3..2d5cf1714ae05 100644
--- a/drivers/target/iscsi/iscsi_target_tpg.c
+++ b/drivers/target/iscsi/iscsi_target_tpg.c
@@ -443,6 +443,9 @@ static bool iscsit_tpg_check_network_portal(
break;
}
spin_unlock(&tpg->tpg_np_lock);
+
+ if (match)
+ break;
}
spin_unlock(&tiqn->tiqn_tpg_lock);
--
2.34.1
next prev parent reply other threads:[~2022-02-03 20:31 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-03 20:28 [PATCH AUTOSEL 5.16 01/52] NFS: change nfs_access_get_cached to only report the mask Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 02/52] NFSv4 only print the label when its queried Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 03/52] nfs: nfs4clinet: check the return value of kstrdup() Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 04/52] NFSv4.1: Fix uninitialised variable in devicenotify Sasha Levin
2022-02-03 20:28 ` [PATCH AUTOSEL 5.16 05/52] netfilter: nf_conntrack_netbios_ns: fix helper module alias Sasha Levin
2022-02-03 21:46 ` Jakub Kicinski
2022-02-03 22:23 ` Florian Westphal
2022-02-11 14:41 ` Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 06/52] NFSv4 remove zero number of fs_locations entries error check Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 07/52] NFSv4 store server support for fs_location attribute Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 08/52] NFSv4.1 query for fs_location attr on a new file system Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 09/52] NFSv4 expose nfs_parse_server_name function Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 10/52] NFSv4 handle port presence in fs_location server string Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 11/52] SUNRPC allow for unspecified transport time in rpc_clnt_add_xprt Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 12/52] net/sunrpc: fix reference count leaks in rpc_sysfs_xprt_state_change Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 13/52] sunrpc: Fix potential race conditions in rpc_sysfs_xprt_state_change() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 14/52] irqchip/realtek-rtl: Service all pending interrupts Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 15/52] perf/x86/rapl: fix AMD event handling Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 16/52] x86/perf: Avoid warning for Arch LBR without XSAVE Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 17/52] sched/pelt: Relax the sync of runnable_sum with runnable_avg Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 18/52] sched: Avoid double preemption in __cond_resched_*lock*() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 19/52] drm/vc4: Fix deadlock on DSI device attach error Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 20/52] drm: panel-orientation-quirks: Add quirk for the 1Netbook OneXPlayer Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 21/52] net: sched: Clarify error message when qdisc kind is unknown Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 22/52] powerpc/fixmap: Fix VM debug warning on unmap Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 23/52] s390/module: test loading modules with a lot of relocations Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 24/52] arm64: Add Cortex-X2 CPU part definition Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 25/52] arm64: errata: Update ARM64_ERRATUM_[2119858|2224489] with Cortex-X2 ranges Sasha Levin
2022-02-03 20:29 ` Sasha Levin [this message]
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 27/52] scsi: ufs: ufshcd-pltfrm: Check the return value of devm_kstrdup() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 28/52] scsi: qedf: Add stag_work to all the vports Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 29/52] scsi: qedf: Fix refcount issue when LOGO is received during TMF Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 30/52] scsi: qedf: Change context reset messages to ratelimited Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 31/52] scsi: pm8001: Fix bogus FW crash for maxcpus=1 Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 32/52] scsi: ufs: Use generic error code in ufshcd_set_dev_pwr_mode() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 33/52] scsi: ufs: Treat link loss as fatal error Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 34/52] scsi: myrs: Fix crash in error case Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 35/52] net: stmmac: reduce unnecessary wakeups from eee sw timer Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 36/52] PM: wakeup: simplify the output logic of pm_show_wakelocks() Sasha Levin
2022-02-04 8:29 ` Greg Kroah-Hartman
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 37/52] PM: hibernate: Remove register_nosave_region_late() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 38/52] drm/amd/display: Correct MPC split policy for DCN301 Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 39/52] drm/amdgpu/display: adjust msleep limit in dp_wait_for_training_aux_rd_interval Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 40/52] drm/amdgpu/display: use msleep rather than udelay for long delays Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 41/52] usb: dwc2: gadget: don't try to disable ep0 in dwc2_hsotg_suspend Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 42/52] perf: Always wake the parent event Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 43/52] nvme-pci: add the IGNORE_DEV_SUBNQN quirk for Intel P4500/P4600 SSDs Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 44/52] MIPS: Fix build error due to PTR used in more places Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 45/52] net: stmmac: dwmac-sun8i: use return val of readl_poll_timeout() Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 46/52] arm64: Add Cortex-A510 CPU part definition Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 47/52] arm64: errata: Add detection for TRBE ignored system register writes Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 48/52] arm64: errata: Add detection for TRBE invalid prohibited states Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 49/52] arm64: errata: Add detection for TRBE trace data corruption Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 50/52] arm64: cpufeature: List early Cortex-A510 parts as having broken dbm Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 51/52] block: add bio_start_io_acct_time() to control start_time Sasha Levin
2022-02-03 20:29 ` [PATCH AUTOSEL 5.16 52/52] kasan: test: fix compatibility with FORTIFY_SOURCE Sasha Levin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220203202947.2304-26-sashal@kernel.org \
--to=sashal@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=michael.christie@oracle.com \
--cc=mingzhe.zou@easystack.cn \
--cc=stable@vger.kernel.org \
--cc=target-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).