PERFORCE change 122480 for review
John Baldwin
jhb at freebsd.org
Fri Jul 13 12:22:33 UTC 2007
On Monday 02 July 2007 09:10:38 am Roman Divacky wrote:
> On Fri, Jun 29, 2007 at 08:52:06PM -0400, John Baldwin wrote:
> > On Thursday 28 June 2007 08:14:43 am Roman Divacky wrote:
> > > http://perforce.freebsd.org/chv.cgi?CH=122480
> > >
> > > Change 122480 by rdivacky at rdivacky_witten on 2007/06/28 12:14:14
> > >
> > > vrele AFTER checking the vp for being on non-MPSAFE FS + some
indentation
> > > problems that caused bad scoping
> > >
> > > Noticed by: rwatson (again ;) )
> >
> > Umm, no. You need Giant for the vrele(). The proper fix is to use the
> > VFS_*_GIANT() macros and use int variables to know if you need to unlock
> > Giant or not.
>
> I dont see an easy and elegant way how to use the VFS_*_GIANT macros. I lock
> the giant in kern_get_at() function and unlock in function that calls this
one. ie.:
>
> foo()
> {
> kern_get_at(...);
> ...
> if (VFS_NEEDSGIANT)
> mtx_unlock(&Giant);
> }
>
> I need to either propagate the vfslocked value from kern_get_at or lock the
Giant in the foo()
> function. honestly I dont like either much
>
> what do you suggest?
I would lock Giant in foo() if you already have the vnode in foo().
--
John Baldwin
More information about the p4-projects
mailing list