From owner-svn-src-stable-8@FreeBSD.ORG Mon Oct 25 06:16:27 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id CA10C106566B; Mon, 25 Oct 2010 06:16:27 +0000 (UTC) (envelope-from kevlo@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id B7B648FC13; Mon, 25 Oct 2010 06:16:27 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9P6GRPX052896; Mon, 25 Oct 2010 06:16:27 GMT (envelope-from kevlo@svn.freebsd.org) Received: (from kevlo@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9P6GR5R052894; Mon, 25 Oct 2010 06:16:27 GMT (envelope-from kevlo@svn.freebsd.org) Message-Id: <201010250616.o9P6GR5R052894@svn.freebsd.org> From: Kevin Lo Date: Mon, 25 Oct 2010 06:16:27 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r214316 - stable/8/sys/fs/msdosfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Oct 2010 06:16:27 -0000 Author: kevlo Date: Mon Oct 25 06:16:27 2010 New Revision: 214316 URL: http://svn.freebsd.org/changeset/base/214316 Log: MFC r214001: Fix a possible, but very unlikely race where the directory dirent is moved to the location that was used by ".." entry. Modified: stable/8/sys/fs/msdosfs/msdosfs_lookup.c Modified: stable/8/sys/fs/msdosfs/msdosfs_lookup.c ============================================================================== --- stable/8/sys/fs/msdosfs/msdosfs_lookup.c Mon Oct 25 05:37:12 2010 (r214315) +++ stable/8/sys/fs/msdosfs/msdosfs_lookup.c Mon Oct 25 06:16:27 2010 (r214316) @@ -594,10 +594,15 @@ msdosfs_deget_dotdot(struct vnode *vp, u vfs_unbusy(mp); if (error == 0) *rvp = DETOV(rdp); - vn_lock(vp, ltype | LK_RETRY); + if (*rvp != vp) + vn_lock(vp, ltype | LK_RETRY); if (vp->v_iflag & VI_DOOMED) { - if (error == 0) - vput(*rvp); + if (error == 0) { + if (*rvp == vp) + vunref(*rvp); + else + vput(*rvp); + } error = ENOENT; } return (error);