diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2009-07-19 16:44:26 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2009-07-19 16:44:26 +0000 |
commit | dcc7a6b868e41acfda89eb8429fe77b97d900678 (patch) | |
tree | c0d963df90906a2f16151bb8ad77b6197b6ec4e7 | |
parent | 5113862d47a88010ff3040edeae45c0997c084ff (diff) | |
download | FreeBSD-src-dcc7a6b868e41acfda89eb8429fe77b97d900678.zip FreeBSD-src-dcc7a6b868e41acfda89eb8429fe77b97d900678.tar.gz |
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)
-rw-r--r-- | sys/fs/nfsclient/nfs_clvfsops.c | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/sys/fs/nfsclient/nfs_clvfsops.c b/sys/fs/nfsclient/nfs_clvfsops.c index 55f1fa4..1f7d208 100644 --- a/sys/fs/nfsclient/nfs_clvfsops.c +++ b/sys/fs/nfsclient/nfs_clvfsops.c @@ -1037,7 +1037,7 @@ mountnfs(struct nfs_args *argp, struct mount *mp, struct sockaddr *nam, { 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 mount *mp, struct sockaddr *nam, 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 mount *mp, struct sockaddr *nam, } } 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; |