On Tue, May 22, 2007 at 08:48:49PM +0200, Miklos Szeredi wrote:
BTW, I'd split that (and matching updates in callers) into separate
patch.
int, surely?
Ouch. What guarantees that two lookups won't race right here? You are
not holding any locks at that point, AFAICS...
BTW, why newpath? What's wrong with simply returning a new vfsmount
with right ->mnt_root/->mnt_sb (instead of creating it inside
mount_dironfile())? ERR_PTR() for error, struct vfsmount * for success...
Hmm? So you do copy them and strip your MNT_DIRONFILE from copies?
You've got to be kidding. nameidata is *big*. If anything, we want
to make detach_mnt() take struct path * instead, but even that is
lousy due to recursion.
I really don't like what's going on here. The thing is, current code
is based on assumption that presence in the mount tree => holding a
reference. We _might_ deal with that (there was an old plan to change
refcounting logics for vfsmounts), but that sort of games with locks
spells trouble. What happens, for example, if namespace gets cloned
before you grab namespace_sem?
There's another problem, BTW - a lot of stuff does stat + open + fstat +
compare kind of sequence. You'll end up mounting/umounting between stat
and open, which opens you to race with somebody else. Get a different
st_dev, eat a nice unreproducible error from application...
-
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html