From owner-svn-src-all@FreeBSD.ORG Mon May 4 21:58:33 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 32389106564A; Mon, 4 May 2009 21:58:33 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 04B5D8FC1D; Mon, 4 May 2009 21:58:33 +0000 (UTC) (envelope-from jhb@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 n44LwWvi058515; Mon, 4 May 2009 21:58:32 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n44LwWjX058513; Mon, 4 May 2009 21:58:32 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200905042158.n44LwWjX058513@svn.freebsd.org> From: John Baldwin Date: Mon, 4 May 2009 21:58:32 +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: r191801 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 04 May 2009 21:58:33 -0000 Author: jhb Date: Mon May 4 21:58:32 2009 New Revision: 191801 URL: http://svn.freebsd.org/changeset/base/191801 Log: MFC: When a file lookup fails due to encountering a doomed vnode from a forced unmount, consistently return ENOENT rather than EBADF. 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/kern/vfs_cache.c stable/7/sys/kern/vfs_lookup.c Modified: stable/7/sys/kern/vfs_cache.c ============================================================================== --- stable/7/sys/kern/vfs_cache.c Mon May 4 21:13:06 2009 (r191800) +++ stable/7/sys/kern/vfs_cache.c Mon May 4 21:58:32 2009 (r191801) @@ -318,7 +318,7 @@ cache_zap(ncp) * (negative cacheing), a status of ENOENT is returned. If the lookup * fails, a status of zero is returned. If the directory vnode is * recycled out from under us due to a forced unmount, a status of - * EBADF is returned. + * ENOENT is returned. * * vpp is locked and ref'd on return. If we're looking up DOTDOT, dvp is * unlocked. If we're looking up . an extra ref is taken, but the lock is @@ -466,7 +466,7 @@ success: /* forced unmount */ vrele(*vpp); *vpp = NULL; - return (EBADF); + return (ENOENT); } } else vn_lock(*vpp, LK_DOWNGRADE | LK_RETRY, td); @@ -939,7 +939,7 @@ vn_fullpath1(struct thread *td, struct v while (vp != rdir && vp != rootvnode) { if (vp->v_vflag & VV_ROOT) { if (vp->v_iflag & VI_DOOMED) { /* forced unmount */ - error = EBADF; + error = ENOENT; break; } vp = vp->v_mount->mnt_vnodecovered; Modified: stable/7/sys/kern/vfs_lookup.c ============================================================================== --- stable/7/sys/kern/vfs_lookup.c Mon May 4 21:13:06 2009 (r191800) +++ stable/7/sys/kern/vfs_lookup.c Mon May 4 21:58:32 2009 (r191801) @@ -532,7 +532,7 @@ dirloop: if ((dp->v_vflag & VV_ROOT) == 0) break; if (dp->v_iflag & VI_DOOMED) { /* forced unmount */ - error = EBADF; + error = ENOENT; goto bad; } tdp = dp; @@ -691,9 +691,11 @@ unionlookup: *ndp->ni_next == '/')) { cnp->cn_flags |= ISSYMLINK; if (dp->v_iflag & VI_DOOMED) { - /* We can't know whether the directory was mounted with - * NOSYMFOLLOW, so we can't follow safely. */ - error = EBADF; + /* + * We can't know whether the directory was mounted with + * NOSYMFOLLOW, so we can't follow safely. + */ + error = ENOENT; goto bad2; } if (dp->v_mount->mnt_flag & MNT_NOSYMFOLLOW) {