Re: patch for 2.1.48 autofs race

Bill Hawes (whawes@star.net)
Fri, 08 Aug 1997 13:24:16 -0400


Linus Torvalds wrote:
> However, I think it actually would be better to do this at the VFS layer,
> and not have the low-level filesystems every know about "dentry counts".
> It's bad form by the VFS layer anyway to let dentries with a zero count be
> around (except when holding the name lookup spinlock, which I still
> haven't gotten around to actually create yet although it should be trivial
> to do as the code has been designed with the spinlock in mind).

I agree completely. I would like to see (1) d_alloc() called without
the parent pointer, and initial d_count=1, (2) in lookup, if the d_alloc
succeeds install the parent pointer via dget(parent), (3) then if
i_op->lookup fails, do a dput(result) instead of d_free. (And remove the
dget(parent) from d_add, since the parent count has been bumped.)

This would shore up what is currently a very fragile interface.

Regards,
Bill