tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: More duplicate code, vnode locking question



On Thu, Apr 23, 2009 at 12:24:48AM +0300, Antti Kantee wrote:

> On Wed Apr 22 2009 at 23:45:01 +0300, Elad Efrat wrote:
> > >> Also, it seems that some file-systems call VOP_OPEN() without devvp
> > >> being locked. Compare, for example, ffs_mount() and efs_mount(). Is
> > >> this possible, or am I missing something? :)
> > >
> > > This is a bug.
> > 
> > Okay. Unless someone beats me to it, once I'm done with some other stuff
> > I'll go over the file-systems and make a patch to add locking where it's
> > missing (in this regard only! :) and post it.
> > 
> > What I have in mind is adding vn_lock() before the VOP_OPEN() call, and
> > adjust error paths to vput() where the vnode is locked and vrele()
> > otherwise. Is this correct?

If it's locked it should unlocked immediately after the VOP_OPEN().

> I already explained why locking it is a bug also.  Why are you replacing
> a bug with a theoretically more severe bug?  Did you disagree with
> my explanation?

Can you specify what new problems it introduces?

The issue I see is that the vnode lock on the directory is being overloaded
to provide protection for mounts, in turn leading to other hacks like
vn_setrecurse().


Home | Main Index | Thread Index | Old Index