kern/135412: commit references a PR
dfilter service
dfilter at FreeBSD.ORG
Wed Jul 1 12:50:06 UTC 2009
The following reply was made to PR kern/135412; it has been noted by GNATS.
From: dfilter at FreeBSD.ORG (dfilter service)
To: bug-followup at FreeBSD.org
Cc:
Subject: Re: kern/135412: commit references a PR
Date: Wed, 1 Jul 2009 12:44:37 +0000 (UTC)
Author: avg
Date: Wed Jul 1 12:44:23 2009
New Revision: 195236
URL: http://svn.freebsd.org/changeset/base/195236
Log:
MFC 185586 (kan): Change nfsserver slightly so that it does not trip
over the timestamp validation code on ZFS.
This should fix O_CREAT|O_EXCL open on NFS where a server is 64-bit
with v13 ZFS code.
PR: kern/135412
Pointed out by: Jaakko Heinonen <jh at saunalahti.fi>
Tested by: Jaakko Heinonen, Danny Braniss <danny at cs.huji.ac.il>
Modified:
stable/7/sys/ (props changed)
stable/7/sys/contrib/pf/ (props changed)
stable/7/sys/nfsserver/nfs_serv.c
Modified: stable/7/sys/nfsserver/nfs_serv.c
==============================================================================
--- stable/7/sys/nfsserver/nfs_serv.c Wed Jul 1 12:36:10 2009 (r195235)
+++ stable/7/sys/nfsserver/nfs_serv.c Wed Jul 1 12:44:23 2009 (r195236)
@@ -1656,13 +1656,12 @@ nfsrv_create(struct nfsrv_descript *nfsd
caddr_t bpos;
int error = 0, rdev, len, tsize, dirfor_ret = 1, diraft_ret = 1;
int v3 = (nfsd->nd_flag & ND_NFSV3), how, exclusive_flag = 0;
- caddr_t cp;
struct mbuf *mb, *mreq;
struct vnode *dirp = NULL;
nfsfh_t nfh;
fhandle_t *fhp;
u_quad_t tempsize;
- u_char cverf[NFSX_V3CREATEVERF];
+ struct timespec cverf;
struct mount *mp = NULL;
int tvfslocked;
int vfslocked;
@@ -1741,8 +1740,11 @@ nfsrv_create(struct nfsrv_descript *nfsd
nfsm_srvsattr(vap);
break;
case NFSV3CREATE_EXCLUSIVE:
- cp = nfsm_dissect_nonblock(caddr_t, NFSX_V3CREATEVERF);
- bcopy(cp, cverf, NFSX_V3CREATEVERF);
+ tl = nfsm_dissect_nonblock(u_int32_t *,
+ NFSX_V3CREATEVERF);
+ /* Unique bytes, endianness is not important. */
+ cverf.tv_sec = tl[0];
+ cverf.tv_nsec = tl[1];
exclusive_flag = 1;
break;
};
@@ -1788,8 +1790,7 @@ nfsrv_create(struct nfsrv_descript *nfsd
if (exclusive_flag) {
exclusive_flag = 0;
VATTR_NULL(vap);
- bcopy(cverf, (caddr_t)&vap->va_atime,
- NFSX_V3CREATEVERF);
+ vap->va_atime = cverf;
error = VOP_SETATTR(nd.ni_vp, vap, cred,
td);
}
@@ -1873,7 +1874,7 @@ nfsrv_create(struct nfsrv_descript *nfsd
}
if (v3) {
if (exclusive_flag && !error &&
- bcmp(cverf, (caddr_t)&vap->va_atime, NFSX_V3CREATEVERF))
+ bcmp(&cverf, &vap->va_atime, sizeof (cverf)))
error = EEXIST;
if (dirp == nd.ni_dvp)
diraft_ret = VOP_GETATTR(dirp, &diraft, cred, td);
_______________________________________________
svn-src-all at freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscribe at freebsd.org"
More information about the freebsd-fs
mailing list