Skip to content

Commit

Permalink
nvmet: make sure discovery change log event is protected
Browse files Browse the repository at this point in the history
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@nvidia.com>
Reviewed-by: Israel Rukshin <israelr@nvidia.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Max Gurtovoy authored and Christoph Hellwig committed Dec 1, 2020
1 parent 6d65aea commit 0068a7b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/nvme/target/discovery.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0068a7b

Please sign in to comment.