Re: Giant pushdown in kern_descrip.c rev 1.128

From: Alfred Perlstein <alfred_at_FreeBSD.org>
Date: Tue, 17 Jun 2003 15:02:31 -0700
* Don Lewis <truckman_at_FreeBSD.org> [030617 13:06] wrote:
> On 17 Jun, Alfred Perlstein wrote:
> > * Don Lewis <truckman_at_FreeBSD.org> [030617 12:00] wrote:
> >> It's not legal to attempt to aquire Giant in fdrop_locked(), while
> >> FILE_LOCK() is held.  The problem is that FILE_LOCK uses the mutex pool,
> >> which should only be used for leaf mutexes.
> >> 
> >> It also looks like there is a potential for a lock order reversal if
> >> some callers aquire Giant before FILE_LOCK() and fdrop_locked() does the
> >> opposite.
> >> 
> >> It also appears that witness ignores the mutex pool ...
> > 
> > Yes, but I think the fix is as simple as just dropping the FILE_LOCK
> > after the decrement as we're the last holders of it, can you try
> > this:
> 
> I like simple fixes, especially when the code shrinks ;-)
> 
> Unfortunately, I think your point about this only happening because this
> process is the last holder of the file means that this doesn't explain
> Peter's deadlock.

You can still deadlock because another file's mutex may hash to the same
location.
Received on Tue Jun 17 2003 - 13:02:32 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:12 UTC