From owner-svn-src-stable@FreeBSD.ORG Wed Jan 21 15:06:54 2009 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 092FC106585F; Wed, 21 Jan 2009 15:06:54 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id E773B8FC24; Wed, 21 Jan 2009 15:06:53 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n0LF6ris081131; Wed, 21 Jan 2009 15:06:53 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n0LF6rwP081130; Wed, 21 Jan 2009 15:06:53 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200901211506.n0LF6rwP081130@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 21 Jan 2009 15:06:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r187531 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb ufs/ufs X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Jan 2009 15:06:57 -0000 Author: kib Date: Wed Jan 21 15:06:53 2009 New Revision: 187531 URL: http://svn.freebsd.org/changeset/base/187531 Log: MFC r185170. r185556: Busy ufs filesystem around block of code that does ".." lookup. Do not lock vnode interlock around reading of v_iflag to check VI_DOOMED. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/dev/ath/ath_hal/ (props changed) stable/7/sys/dev/cxgb/ (props changed) stable/7/sys/ufs/ufs/ufs_lookup.c Modified: stable/7/sys/ufs/ufs/ufs_lookup.c ============================================================================== --- stable/7/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 15:04:06 2009 (r187530) +++ stable/7/sys/ufs/ufs/ufs_lookup.c Wed Jan 21 15:06:53 2009 (r187531) @@ -158,6 +158,7 @@ ufs_lookup(ap) struct thread *td = cnp->cn_thread; ino_t ino; int ltype; + struct mount *mp; bp = NULL; slotoffset = -1; @@ -579,9 +580,26 @@ found: pdp = vdp; if (flags & ISDOTDOT) { ltype = VOP_ISLOCKED(pdp, td); + mp = pdp->v_mount; + for (;;) { + error = vfs_busy(mp, LK_NOWAIT, NULL, td); + if (error == 0) + break; + VOP_UNLOCK(pdp, 0, td); + pause("ufs_dd", 1); + vn_lock(pdp, ltype | LK_RETRY, td); + if (pdp->v_iflag & VI_DOOMED) + return (ENOENT); + } VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ - error = VFS_VGET(pdp->v_mount, ino, cnp->cn_lkflags, &tdp); + error = VFS_VGET(mp, ino, cnp->cn_lkflags, &tdp); + vfs_unbusy(mp, td); vn_lock(pdp, ltype | LK_RETRY, td); + if (pdp->v_iflag & VI_DOOMED) { + if (error == 0) + vput(tdp); + error = ENOENT; + } if (error) return (error); *vpp = tdp;