From owner-freebsd-current@FreeBSD.ORG Sat Jan 10 01:07:43 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id DA94A106566C for ; Sat, 10 Jan 2009 01:07:43 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: from mail-bw0-f20.google.com (mail-bw0-f20.google.com [209.85.218.20]) by mx1.freebsd.org (Postfix) with ESMTP id 0EC168FC19 for ; Sat, 10 Jan 2009 01:07:42 +0000 (UTC) (envelope-from yanefbsd@gmail.com) Received: by bwz13 with SMTP id 13so3415908bwz.19 for ; Fri, 09 Jan 2009 17:07:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:cc:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:references; bh=ARu64j6IKa0oCIRJd9AjOm9xPr4XNaDQV2+dVGwZHz4=; b=DaKme8GyFHJ9z0QdSefjYyootYvBARrzi5d6tegEdDm6TD4LO7fScbsOFK493JcIDt No9sNXVFjYe+/++Lbx32Jr7g3SiRZR9ynKgCsMxKZQZfU/XCTGL2oKbtKx0sJBUgJk3F PKTg0+caLPhjAP8Si8n8YoJ3Ahk9BFAPbudtU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :references; b=ocCfTku3JKJesJvWXaJWk9x+zlho0xpJHTyrSXNKSiD24fOGulrjNP+08ZoFTMRUCR RrQJvKSchYpgCs99JFRMA2KXkT34WEzuUpVKw4AF0OD3M392XeKs2ZlFJS4uQonDuiAL O34jxgN7jb8dZGBe8BqOiP93h9sG5UhoGPdRQ= Received: by 10.223.124.137 with SMTP id u9mr19115660far.96.1231549661951; Fri, 09 Jan 2009 17:07:41 -0800 (PST) Received: by 10.67.88.9 with HTTP; Fri, 9 Jan 2009 17:07:41 -0800 (PST) Message-ID: <7d6fde3d0901091707u7e2ee080l75d8567a4093144d@mail.gmail.com> Date: Fri, 9 Jan 2009 17:07:41 -0800 From: "Garrett Cooper" To: "Joe Marcus Clarke" In-Reply-To: <1231541342.56664.19.camel@shumai.marcuscom.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <20090109004853.GA34384@ichotolot.servalan.com> <1231541342.56664.19.camel@shumai.marcuscom.com> Cc: Richard Todd , freebsd-current@freebsd.org Subject: Re: Recent changes to pseudofs causing panics -- leaking a vnode lock? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 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: Sat, 10 Jan 2009 01:07:44 -0000 On Fri, Jan 9, 2009 at 2:49 PM, Joe Marcus Clarke wrote: > On Thu, 2009-01-08 at 18:48 -0600, Richard Todd wrote: >> I've noticed that ever since updating to a kernel after the recent changes >> to the pseudofs code late last month, that I've occasionally gotten the >> following sort of panic: >> >> System call readlink returning with the following locks held: >> exclusive lockmgr pseudofs (pseudofs) r = 0 (0xffffff00ba581cc8) locked @ /usr/src/sys/fs/pseudofs/pseudofs_vncache.c:193 >> panic: witness_warn >> >> The line in question is the one I marked by an arrow in this chunk of the >> pfs_vncache_alloc code: >> if ((pn->pn_flags & PFS_PROCDEP) != 0) >> (*vpp)->v_vflag |= VV_PROCDEP; >> pvd->pvd_vnode = *vpp; >> VN_LOCK_AREC(*vpp); >> vn_lock(*vpp, LK_EXCLUSIVE | LK_RETRY); <==== this lock here >> error = insmntque(*vpp, mp); >> >> So somehow, a vnode is getting locked here and not getting unlocked. >> I suspect the code in the retry2: loop later, simply because that's >> the code that got added in the late December commits, but I'm not >> clear on how exactly. I've tried littering the code with extra >> printfs to try to clarify what's going on, but alas, I'm still not >> really sure what's going on. I do have a good coredump that I can get >> info out of, if someone can suggest to me what would be useful things >> to dump. Anyway, here's the patch for the debugging printfs I added, >> and the console messages produced by those printfs from the most >> recent coredump/panic. The console msgs do seem to indicate some sort >> of race condition going on, though, as they seem to show two or more processes >> simultaneously hitting the pseudofs code and hitting my debugging print >> statements (alas, making the console log rather a confused mess.) > > I believe I have fixed this in HEAD. Kib gave his review and approval, > and the fix really should prevent this hang. Please report back if you > still see the problem. > > Joe Joe, When did you do this commit / what's the SVN revision #? Thanks! -Garrett