diff options
author | rmacklem <rmacklem@FreeBSD.org> | 2012-01-27 02:46:12 +0000 |
---|---|---|
committer | rmacklem <rmacklem@FreeBSD.org> | 2012-01-27 02:46:12 +0000 |
commit | 67ad565252d3d34bb8ca2cf69cd14196e9cde25a (patch) | |
tree | 20a610ef86d52095dc46dd3bd040e3c75437f1a9 /sys/fs/nfsclient/nfs_clnode.c | |
parent | e7de0310724405390676f8aecbe28e852265b02a (diff) | |
download | FreeBSD-src-67ad565252d3d34bb8ca2cf69cd14196e9cde25a.zip FreeBSD-src-67ad565252d3d34bb8ca2cf69cd14196e9cde25a.tar.gz |
A problem with respect to data read through the buffer cache for both
NFS clients was reported to freebsd-fs@ under the subject "NFS
corruption in recent HEAD" on Nov. 26, 2011. This problem occurred when
a TCP mounted root fs was changed to using UDP. I believe that this
problem was caused by the change in mnt_stat.f_iosize that occurred
because rsize was decreased to the maximum supported by UDP. This
patch fixes the problem by using v_bufobj.bo_bsize instead of f_iosize,
since the latter is set to f_iosize when the vnode is allocated, but
does not change for a given vnode when f_iosize changes.
Reported by: pjd
Reviewed by: kib
MFC after: 2 weeks
Diffstat (limited to 'sys/fs/nfsclient/nfs_clnode.c')
-rw-r--r-- | sys/fs/nfsclient/nfs_clnode.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clnode.c b/sys/fs/nfsclient/nfs_clnode.c index 5e7185d..21de25e 100644 --- a/sys/fs/nfsclient/nfs_clnode.c +++ b/sys/fs/nfsclient/nfs_clnode.c @@ -136,6 +136,7 @@ ncl_nget(struct mount *mntp, u_int8_t *fhp, int fhsize, struct nfsnode **npp, return (error); } vp = nvp; + KASSERT(vp->v_bufobj.bo_bsize != 0, ("ncl_nget: bo_bsize == 0")); vp->v_bufobj.bo_ops = &buf_ops_newnfs; vp->v_data = np; np->n_vnode = vp; |