* [PATCH 1/1] nvmet: add safety check for subsystem lock during nvmet_ns_changed
@ 2019-04-02 11:51 Max Gurtovoy
2019-04-02 11:55 ` Johannes Thumshirn
2019-04-04 6:14 ` Christoph Hellwig
0 siblings, 2 replies; 3+ messages in thread
From: Max Gurtovoy @ 2019-04-02 11:51 UTC (permalink / raw)
we need to make sure that subsystem lock is taken during ctrl's list
traversing. nvmet_ns_changed function is not static and can be used from
various callers simultaneously.
Signed-off-by: Max Gurtovoy <maxg at mellanox.com>
---
drivers/nvme/target/core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c
index b3e765a..d42de97 100644
--- a/drivers/nvme/target/core.c
+++ b/drivers/nvme/target/core.c
@@ -214,6 +214,8 @@ void nvmet_ns_changed(struct nvmet_subsys *subsys, u32 nsid)
{
struct nvmet_ctrl *ctrl;
+ lockdep_assert_held(&subsys->lock);
+
list_for_each_entry(ctrl, &subsys->ctrls, subsys_entry) {
nvmet_add_to_changed_ns_log(ctrl, cpu_to_le32(nsid));
if (nvmet_aen_bit_disabled(ctrl, NVME_AEN_BIT_NS_ATTR))
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-04-04 6:14 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-04-02 11:51 [PATCH 1/1] nvmet: add safety check for subsystem lock during nvmet_ns_changed Max Gurtovoy
2019-04-02 11:55 ` Johannes Thumshirn
2019-04-04 6:14 ` Christoph Hellwig
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.