On Wed, Sep 06, 2017 at 05:37:28PM +0200, David Sterba wrote:
> On Tue, Aug 22, 2017 at 11:46:03PM -0700, Omar Sandoval wrote:
> > From: Omar Sandoval <osan...@fb.com>
> > 
> > A naked read of the value of an RCU pointer isn't safe. Put the whole
> > access in an RCU critical section, not just the pointer dereference.
> 
> In this case it is safe, as the device will not go away (and potentially
> free dev->name) because it's under the device_list_mutex.
> 
> The locking around devices and related structures is not exactly
> straightforward, but here I don't think we need to stick to the RCU
> pattern if the protection is guaranteed by other means. This applies to
> uuid_mutex and device_list_mutex.

You're right, it's a little confusing because uuid_mutex protects
device->name, so under device_list_mutex, device->name might change but
will never become NULL. We can just drop this one, thanks!
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to