[PATCH 1/1] nvmet: make sure discovery change log event is protected

Max Gurtovoy mgurtovoy at nvidia.com
Wed Nov 25 07:27:36 EST 2020


Generation counter is protected by nvmet_config_sem. Make sure the
callers that call functions that might change it, are calling it
properly.

Signed-off-by: Max Gurtovoy <mgurtovoy at nvidia.com>
Reviewed-by: Israel Rukshin <israelr at nvidia.com>
---
 drivers/nvme/target/discovery.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/nvme/target/discovery.c b/drivers/nvme/target/discovery.c
index f40c05c33c3a..682854e0e079 100644
--- a/drivers/nvme/target/discovery.c
+++ b/drivers/nvme/target/discovery.c
@@ -69,6 +69,7 @@ void nvmet_subsys_disc_changed(struct nvmet_subsys *subsys,
 	struct nvmet_port *port;
 	struct nvmet_subsys_link *s;
 
+	lockdep_assert_held(&nvmet_config_sem);
 	nvmet_genctr++;
 
 	list_for_each_entry(port, nvmet_ports, global_entry)
-- 
2.25.4




More information about the Linux-nvme mailing list