Messages in this thread | | | Date | Fri, 30 Aug 2013 14:03:59 -0700 | Subject | Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount | From | Linus Torvalds <> |
| |
On Fri, Aug 30, 2013 at 1:54 PM, Al Viro <viro@zeniv.linux.org.uk> wrote: > > Not really. Sure, you'll retry it if you race with d_move(); that's not > the real problem - access past the end of the object containing ->d_name.name > would screw you and that's what ->d_lock is preventing there. Delayed freeing > of what ->d_name is pointing into is fine, but it's not the only way to get > hurt there...
Umm? We follow d->d_name.name without d_lock under RCU all the time - that's what the pathname lookup is all about, after all.
Yes, yes, you haev to be careful and cannot just blindly trust the length: you also have to check for NUL character as you are copying it and stop if you hit it. But that's trivial.
Why would d_prepend be any different?
Linus
| |