Re: [PATCH v7 1/4] spinlock: A new lockref structure for locklessupdate of refcount

From: Linus Torvalds
Date: Fri Aug 30 2013 - 17:04:05 EST


On Fri, Aug 30, 2013 at 1:54 PM, Al Viro <viro@xxxxxxxxxxxxxxxxxx> 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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/