From owner-svn-src-head@FreeBSD.ORG Sun Jul 19 16:44:27 2009 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 07D6D106564A; Sun, 19 Jul 2009 16:44:27 +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 E90DA8FC34; Sun, 19 Jul 2009 16:44:26 +0000 (UTC) (envelope-from rmacklem@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 n6JGiQIT048399; Sun, 19 Jul 2009 16:44:26 GMT (envelope-from rmacklem@svn.freebsd.org) Received: (from rmacklem@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JGiQ6B048397; Sun, 19 Jul 2009 16:44:26 GMT (envelope-from rmacklem@svn.freebsd.org) Message-Id: <200907191644.n6JGiQ6B048397@svn.freebsd.org> From: Rick Macklem Date: Sun, 19 Jul 2009 16:44:26 +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: r195762 - head/sys/fs/nfsclient 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, 19 Jul 2009 16:44:27 -0000 Author: rmacklem Date: Sun Jul 19 16:44:26 2009 New Revision: 195762 URL: http://svn.freebsd.org/changeset/base/195762 Log: Fix two bugs in the experimental nfs client: - When the root vnode was acquired during mounting, mnt_stat.f_iosize was still set to 0, so getnewvnode() would set bo_bsize == 0. This would confuse getblk(), so that it always returned the first block causing the problem when the root directory of the mount point was greater than one block in size. It was fixed by setting mnt_stat.f_iosize to NFS_DIRBLKSIZ before calling ncl_nget() to acquire the root vnode. - NFSMNT_INT was being set temporarily while the initial connect to a server was being done. This erroneously configured the krpc for interruptible RPCs, which caused problems because signals weren't being masked off as they would have been for interruptible mounts. This code was deleted to fix the problem. Since mount_nfs does an NFS null RPC before the mount system call, connections to the server should work ok. Tested by: swell dot k at gmail dot com Approved by: re (kensmith), kib (mentor) Modified: head/sys/fs/nfsclient/nfs_clvfsops.c Modified: head/sys/fs/nfsclient/nfs_clvfsops.c ============================================================================== --- head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 15:21:42 2009 (r195761) +++ head/sys/fs/nfsclient/nfs_clvfsops.c Sun Jul 19 16:44:26 2009 (r195762) @@ -1037,7 +1037,7 @@ mountnfs(struct nfs_args *argp, struct m { struct nfsmount *nmp; struct nfsnode *np; - int error, trycnt, ret, clearintr; + int error, trycnt, ret; struct nfsvattr nfsva; static u_int64_t clval = 0; @@ -1152,20 +1152,8 @@ mountnfs(struct nfs_args *argp, struct m nmp->nm_sockreq.nr_vers = NFS_VER2; - /* - * For Connection based sockets (TCP,...) do the connect here, - * but make it interruptible, even for non-interuptible mounts. - */ - if ((nmp->nm_flag & NFSMNT_INT) == 0) { - nmp->nm_flag |= NFSMNT_INT; - clearintr = 1; - } else { - clearintr = 0; - } if ((error = newnfs_connect(nmp, &nmp->nm_sockreq, cred, td, 0))) goto bad; - if (clearintr) - nmp->nm_flag &= ~NFSMNT_INT; /* * A reference count is needed on the nfsnode representing the @@ -1194,6 +1182,12 @@ mountnfs(struct nfs_args *argp, struct m } } if (nmp->nm_fhsize > 0) { + /* + * Set f_iosize to NFS_DIRBLKSIZ so that bo_bsize gets set + * non-zero for the root vnode. f_iosize will be set correctly + * by nfs_statfs() before any I/O occurs. + */ + mp->mnt_stat.f_iosize = NFS_DIRBLKSIZ; error = ncl_nget(mp, nmp->nm_fh, nmp->nm_fhsize, &np); if (error) goto bad;