From owner-svn-src-head@FreeBSD.ORG Sun Nov 16 21:56:29 2008 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E289E1065680; Sun, 16 Nov 2008 21:56:29 +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 D36848FC08; Sun, 16 Nov 2008 21:56:29 +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 mAGLuTZi065605; Sun, 16 Nov 2008 21:56:29 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id mAGLuTSe065604; Sun, 16 Nov 2008 21:56:29 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200811162156.mAGLuTSe065604@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 16 Nov 2008 21:56:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r185011 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Nov 2008 21:56:30 -0000 Author: kib Date: Sun Nov 16 21:56:29 2008 New Revision: 185011 URL: http://svn.freebsd.org/changeset/base/185011 Log: Revert r184118. There is actually a code in the kernel, for instance in kern_unlinkat(), that expects that vn_start_write() actually fills the mp even when the call failed. As Tor noted, that pattern relies on the the type stability of the mount points, as well as that suspended mount points are never freed and V_XSLEEP is always passed to vn_start_write() when called on a freed mount point. Reported by: stass Reviewed by: tegge PR: 123768 Modified: head/sys/kern/vfs_vnops.c Modified: head/sys/kern/vfs_vnops.c ============================================================================== --- head/sys/kern/vfs_vnops.c Sun Nov 16 21:26:56 2008 (r185010) +++ head/sys/kern/vfs_vnops.c Sun Nov 16 21:56:29 2008 (r185011) @@ -977,17 +977,12 @@ vn_start_write(vp, mpp, flags) while ((mp->mnt_kern_flag & MNTK_SUSPEND) != 0) { if (flags & V_NOWAIT) { error = EWOULDBLOCK; - if (vp != NULL) - *mpp = NULL; goto unlock; } error = msleep(&mp->mnt_flag, MNT_MTX(mp), (PUSER - 1) | (flags & PCATCH), "suspfs", 0); - if (error) { - if (vp != NULL) - *mpp = NULL; + if (error) goto unlock; - } } } if (flags & V_XSLEEP) @@ -1051,8 +1046,6 @@ vn_start_secondary_write(vp, mpp, flags) if (flags & V_NOWAIT) { MNT_REL(mp); MNT_IUNLOCK(mp); - if (vp != NULL) - *mpp = NULL; return (EWOULDBLOCK); } /* @@ -1063,8 +1056,6 @@ vn_start_secondary_write(vp, mpp, flags) vfs_rel(mp); if (error == 0) goto retry; - if (vp != NULL) - *mpp = NULL; return (error); }