Date: Sun, 19 Jul 2009 16:44:26 +0000 (UTC) From: Rick Macklem <rmacklem@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r195762 - head/sys/fs/nfsclient Message-ID: <200907191644.n6JGiQ6B048397@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200907191644.n6JGiQ6B048397>