[PATCH v2] nvmet: add missing locks around nvmet_ns_revalidate

Chaitanya Kulkarni chaitanyak at nvidia.com
Wed Mar 9 17:50:24 PST 2022


On 3/9/22 17:25, 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.
> 
> This issue was found using a static type-based analyser and manually
> verified.
> 
> Signed-off-by: Niels Dossche <dossche.niels at gmail.com>
> ---
> 
> Changes in v2:
>   - added sentence about how the issue was found.
>   - added missing &
> 


Thanks, looks good.

Reviewed-by: Chaitanya Kulkarni <kch at nvidia.com>

-ck




More information about the Linux-nvme mailing list