From owner-cvs-all@FreeBSD.ORG Sun Jun 1 10:39:23 2003 Return-Path: Delivered-To: cvs-all@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4430337B401; Sun, 1 Jun 2003 10:39:23 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 38A7443F3F; Sun, 1 Jun 2003 10:39:22 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Received: from FreeBSD.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.9/8.12.9) with ESMTP id h51HdCM7004578; Sun, 1 Jun 2003 10:39:17 -0700 (PDT) (envelope-from truckman@FreeBSD.org) Message-Id: <200306011739.h51HdCM7004578@gw.catspoiler.org> Date: Sun, 1 Jun 2003 10:39:12 -0700 (PDT) From: Don Lewis To: des@ofug.org In-Reply-To: MIME-Version: 1.0 Content-Type: TEXT/plain; charset=us-ascii cc: cvs-src@FreeBSD.org cc: src-committers@FreeBSD.org cc: cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/fs/pseudofs pseudofs_vnops.c X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Jun 2003 17:39:23 -0000 On 1 Jun, Dag-Erling Smorgrav wrote: > Don Lewis writes: >> Modified files: >> sys/fs/pseudofs pseudofs_vnops.c >> Log: >> Don't unlock the parent directory vnode twice if the ISDOTDOT flag >> is set. > > des@dwp ~% grep pseudofs /usr/src/MAINTAINERS > pseudofs des Advance notification requested. Sorry, though ... ------ Forwarded message ------ From: Don Lewis Subject: possible patch for vnode double unlock in pfs_lookup() Date: Wed, 21 May 2003 23:20:49 -0700 (PDT) To: des@FreeBSD.org, jeff@FreeBSD.org Cc: current@FreeBSD.org If the ISDOTDOT flag is set and the lockparent or ISLASTCN flags are not set, pfs_lookup() unlocks the same vnode twice. This can be observed by running find / -print with the DEBUG_VFS_LOCKS kernel option enabled. I think the following is the correct patch: I believe that it is safe to defer committing a fix until after 5.1-RELEASE. Index: sys/fs/pseudofs/pseudofs_vnops.c =================================================================== RCS file: /home/ncvs/src/sys/fs/pseudofs/pseudofs_vnops.c,v retrieving revision 1.35 diff -u -r1.35 pseudofs_vnops.c --- sys/fs/pseudofs/pseudofs_vnops.c 2 Mar 2003 22:23:45 -0000 1.35 +++ sys/fs/pseudofs/pseudofs_vnops.c 22 May 2003 04:40:09 -0000 @@ -411,7 +411,8 @@ vn_lock(vn, LK_EXCLUSIVE|LK_RETRY, cnp->cn_thread); cnp->cn_flags &= ~PDIRUNLOCK; } - if (!lockparent || !(cnp->cn_flags & ISLASTCN)) + if ((!lockparent || !(cnp->cn_flags & ISLASTCN)) && + !(cnp->cn_flags & ISDOTDOT)) VOP_UNLOCK(vn, 0, cnp->cn_thread); /* ------ End forwarded message ------ The patch I committed DeMorgan-ized the expression so that it isn't quite as !-happy. You might also want to look for the message I sent to -current about 8 hours ago with the subject "vnode locking problem in pseudofs/procfs".