From owner-freebsd-current Fri Feb 1 11: 1:43 2002 Delivered-To: freebsd-current@freebsd.org Received: from elvis.mu.org (elvis.mu.org [192.203.228.196]) by hub.freebsd.org (Postfix) with ESMTP id A03E637B402 for ; Fri, 1 Feb 2002 11:01:30 -0800 (PST) Received: by elvis.mu.org (Postfix, from userid 1192) id 809FF10DDF7; Fri, 1 Feb 2002 11:01:30 -0800 (PST) Date: Fri, 1 Feb 2002 11:01:30 -0800 From: Alfred Perlstein To: Bruce Evans Cc: current@freebsd.org Subject: Re: lock reversal in fdalloc() Message-ID: <20020201110130.R18604@elvis.mu.org> References: <20020201043751.O5590-100000@gamplex.bde.org> <20020131104831.E18604@elvis.mu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020131104831.E18604@elvis.mu.org>; from alfred@freebsd.org on Thu, Jan 31, 2002 at 10:48:32AM -0800 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG * Alfred Perlstein [020131 10:48] wrote: > * Bruce Evans [020131 09:42] wrote: > > > > I'm not sure that releasing the lock here is safe, but other parts of > > fdalloc() do this. > > I don't think this is safe at a glance, I think it's only safe right > before return'ing from the function. I'll look at it later tonight. It's actually safe... however.... dup2 thinks that we won't race for the file slot: if (new >= fdp->fd_nfiles) { if ((error = fdalloc(td, new, &i))) { FILEDESC_UNLOCK(fdp); return (error); } if (new != i) panic("dup2: fdalloc"); /* * fdalloc() may block, retest everything. */ goto retry; } basically it seems to get pissy if it doesn't get the file slot it asks for, so if another thread wins the race here, we'll panic. this problem seems to also exist for 4.x and previous versions of freebsd. I'd like to get this fixed. Any suggestions? I think simply removing the assertion should remove this hazzard, correct? -- -Alfred Perlstein [alfred@freebsd.org] 'Instead of asking why a piece of software is using "1970s technology," start asking why software is ignoring 30 years of accumulated wisdom.' Tax deductable donations for FreeBSD: http://www.freebsdfoundation.org/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message