[PATCH] nvmet: add missing locks around nvmet_ns_revalidate

Bart Van Assche bvanassche at acm.org
Wed Mar 9 14:27:46 PST 2022


On 3/9/22 12:34, Niels Dossche wrote:
> nvmet_ns_changed states via lockdep that the ns->subsys->lock must be
> held. The only caller of nvmet_ns_changed which does not acquire that
> lock is nvmet_ns_revalidate. The only 2 callers of nvmet_ns_revalidate
> which do not acquire that lock are nvmet_execute_identify_cns_cs_ns and
> nvmet_execute_identify_ns. Add a lock for around the call to
> nvmet_ns_revalidate in those 2 functions.
> 
> Both of those identify functions are called from a common function
> nvmet_execute_identify, which itself is called indirectly via the
> req->execute function pointer.

Please mention in the patch description whether this has been discovered 
by studying the source code or by software (static source code analyzer? 
runtime data race detector?).

Thanks,

Bart.



More information about the Linux-nvme mailing list