Skip to contentSkip to conversation

nvmet: make sure discovery change log event is protected

PATCH Applied Max Gurtovoy 4 participants 4 messages Nov 25, 2020 – Nov 26, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

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

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

---
 drivers/nvme/target/discovery.c | 1 +
 1 file changed, 1 insertion(+)
drivers/nvme/target/discovery.c +1 -0
index f40c05c33c3a..682854e0e079 100644
@@ -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)
Signature · 7 lines
2.25.4


_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme
Reviewed-by on v1 1/1
#2 lore raw
In reply to Max Gurtovoy
Quoted 6 lines · Max Gurtovoy

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

Looks good.

_______________________________________________
Linux-nvme mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-nvme