From owner-svn-src-stable@FreeBSD.ORG Wed Nov 3 08:34:01 2010 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 2B747106564A; Wed, 3 Nov 2010 08:34:01 +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 F2C7A8FC18; Wed, 3 Nov 2010 08:34:00 +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 oA38Y0RA013031; Wed, 3 Nov 2010 08:34:00 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id oA38Y0IC013029; Wed, 3 Nov 2010 08:34:00 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <201011030834.oA38Y0IC013029@svn.freebsd.org> From: Konstantin Belousov Date: Wed, 3 Nov 2010 08:34:00 +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: r214727 - stable/8/sys/nfsserver 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, 03 Nov 2010 08:34:01 -0000 Author: kib Date: Wed Nov 3 08:34:00 2010 New Revision: 214727 URL: http://svn.freebsd.org/changeset/base/214727 Log: MFC r214049: When readdirplus() is handled on the exported filesystem that does not support VFS_VGET, like msdosfs, do not call VOP_LOOKUP() for dotdot on the root directory. Our filesystems expect that VFS handles dotdot lookups on root on its own. Modified: stable/8/sys/nfsserver/nfs_serv.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) stable/8/sys/dev/xen/xenpci/ (props changed) Modified: stable/8/sys/nfsserver/nfs_serv.c ============================================================================== --- stable/8/sys/nfsserver/nfs_serv.c Wed Nov 3 07:51:33 2010 (r214726) +++ stable/8/sys/nfsserver/nfs_serv.c Wed Nov 3 08:34:00 2010 (r214727) @@ -3036,7 +3036,7 @@ nfsrv_readdirplus(struct nfsrv_descript struct iovec iv; struct vattr va, at, *vap = &va; struct nfs_fattr *fp; - int len, nlen, rem, xfer, tsiz, i, error = 0, getret = 1; + int len, nlen, rem, xfer, tsiz, i, error = 0, error1, getret = 1; int siz, cnt, fullsiz, eofflag, rdonly, dirlen, ncookies; u_quad_t off, toff, verf; u_long *cookies = NULL, *cookiep; /* needs to be int64_t or off_t */ @@ -3240,24 +3240,25 @@ again: } if (!VOP_ISLOCKED(vp)) vn_lock(vp, LK_SHARED | LK_RETRY); - if (VOP_LOOKUP(vp, &nvp, &cn) != 0) + if ((vp->v_vflag & VV_ROOT) != 0 && + (cn.cn_flags & ISDOTDOT) != 0) { + vref(vp); + nvp = vp; + } else if (VOP_LOOKUP(vp, &nvp, &cn) != 0) goto invalid; } bzero((caddr_t)nfhp, NFSX_V3FH); nfhp->fh_fsid = nvp->v_mount->mnt_stat.f_fsid; - if (VOP_VPTOFH(nvp, &nfhp->fh_fid)) { + if ((error1 = VOP_VPTOFH(nvp, &nfhp->fh_fid)) == 0) + error1 = VOP_GETATTR(nvp, vap, cred); + if (vp == nvp) + vunref(nvp); + else vput(nvp); - nvp = NULL; - goto invalid; - } - if (VOP_GETATTR(nvp, vap, cred)) { - vput(nvp); - nvp = NULL; - goto invalid; - } - vput(nvp); nvp = NULL; + if (error1 != 0) + goto invalid; /* * If either the dircount or maxcount will be