From owner-freebsd-current@FreeBSD.ORG Tue Jun 17 15:02:32 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 13D7737B401; Tue, 17 Jun 2003 15:02:32 -0700 (PDT) Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by mx1.FreeBSD.org (Postfix) with ESMTP id A9F4043F93; Tue, 17 Jun 2003 15:02:31 -0700 (PDT) (envelope-from bright@elvis.mu.org) Received: by elvis.mu.org (Postfix, from userid 1192) id 870BF2ED412; Tue, 17 Jun 2003 15:02:31 -0700 (PDT) Date: Tue, 17 Jun 2003 15:02:31 -0700 From: Alfred Perlstein To: Don Lewis Message-ID: <20030617220231.GV62025@elvis.mu.org> References: <20030617190735.GU62025@elvis.mu.org> <200306172006.h5HK6lM7052632@gw.catspoiler.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200306172006.h5HK6lM7052632@gw.catspoiler.org> User-Agent: Mutt/1.4.1i cc: current@FreeBSD.org Subject: Re: Giant pushdown in kern_descrip.c rev 1.128 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Jun 2003 22:02:32 -0000 * Don Lewis [030617 13:06] wrote: > On 17 Jun, Alfred Perlstein wrote: > > * Don Lewis [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.