From owner-svn-src-all@FreeBSD.ORG Mon Jan 17 01:37:39 2011 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 D21591065670; Mon, 17 Jan 2011 01:37:39 +0000 (UTC) (envelope-from rmacklem@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 77D3A8FC13; Mon, 17 Jan 2011 01:37:39 +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 p0H1bd9X083995; Mon, 17 Jan 2011 01:37:39 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p0H1bdvY083993; Mon, 17 Jan 2011 01:37:39 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <201101170137.p0H1bdvY083993@svn.freebsd.org> From: Rick Macklem Date: Mon, 17 Jan 2011 01:37:39 +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: r217496 - stable/8/sys/fs/nfsserver 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, 17 Jan 2011 01:37:39 -0000 Author: rmacklem Date: Mon Jan 17 01:37:39 2011 New Revision: 217496 URL: http://svn.freebsd.org/changeset/base/217496 Log: MFC: r217017 Fix the experimental NFS server to use vfs_busyfs() instead of vfs_getvfs() so that the mount point is busied for the VFS_FHTOVP() call. This is analagous to r185432 for the regular NFS server. Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) Modified: stable/8/sys/fs/nfsserver/nfs_nfsdport.c ============================================================================== --- stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:26:13 2011 (r217495) +++ stable/8/sys/fs/nfsserver/nfs_nfsdport.c Mon Jan 17 01:37:39 2011 (r217496) @@ -2548,8 +2548,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s /* * Check for the special case of the nfsv4root_fh. */ - mp = vfs_getvfs(&fhp->fh_fsid); - if (!mp) { + mp = vfs_busyfs(&fhp->fh_fsid); + if (mp == NULL) { *vpp = NULL; nd->nd_repstat = ESTALE; if (*mpp && exp->nes_vfslocked) @@ -2575,6 +2575,7 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s nd->nd_repstat = nfsvno_fhtovp(mp, fhp, nd->nd_nam, lktype, vpp, exp, &credanon); + vfs_unbusy(mp); /* * For NFSv4 without a pseudo root fs, unexported file handles @@ -2636,11 +2637,8 @@ nfsd_fhtovp(struct nfsrv_descript *nd, s VFS_UNLOCK_GIANT(mp); exp->nes_vfslocked = 0; } - vfs_rel(mp); *vpp = NULL; *mpp = NULL; - } else { - vfs_rel(mp); } } @@ -2780,10 +2778,11 @@ nfsvno_getvp(fhandle_t *fhp) struct vnode *vp; int error; - mp = vfs_getvfs(&fhp->fh_fsid); + mp = vfs_busyfs(&fhp->fh_fsid); if (mp == NULL) return (NULL); error = VFS_FHTOVP(mp, &fhp->fh_fid, &vp); + vfs_unbusy(mp); if (error) return (NULL); return (vp);