[PATCH] nvme: fix (S)RCU protection of nvme_ns_head list (alternate)

Sagi Grimberg sagi at grimberg.me
Wed Nov 30 00:40:40 PST 2022


>> I understand what you mean in general, but in this particular case
>> I don't understand what is not working.
> 
> How does this work?

Particularly, the sleeping contexts are guaranteed not to dereference
this NS after the two previous srcu synchronization steps so at this
point, the only protection of nvme_ns_remove is against this
non-sleepable traversal, which should be enough to protect with rcu.

>> But, if this is too confusing we can make everything srcu protected
>> and be done with it.
> 
> To me the original patch looks like correct and reasonable, so I'd
> prefer to go with that.  We can then look into optimizing the
> SRCU usage later if needed.

That is fine with me.



More information about the Linux-nvme mailing list