Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Jun 2003 20:08:50 -0700 (PDT)
From:      Don Lewis <truckman@FreeBSD.org>
To:        alfred@FreeBSD.org
Cc:        current@FreeBSD.org
Subject:   Re: Giant pushdown in kern_descrip.c rev 1.128
Message-ID:  <200306180308.h5I38oM7053457@gw.catspoiler.org>
In-Reply-To: <20030617220231.GV62025@elvis.mu.org>

index | next in thread | previous in thread | raw e-mail

On 17 Jun, Alfred Perlstein wrote:
> * Don Lewis <truckman@FreeBSD.org> [030617 13:06] wrote:
>> On 17 Jun, Alfred Perlstein wrote:
>> > * Don Lewis <truckman@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.

... or some other user of the mutex pool that happens to hold Giant.

I'm in favor of committing your patch, though I think it should be
commented to indicate why it is safe to play with fp after the mutex has
been unlocked.


help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200306180308.h5I38oM7053457>