summaryrefslogtreecommitdiffstats
path: root/sys/nfs4client/nfs4_vfsops.c
diff options
context:
space:
mode:
authorrees <rees@FreeBSD.org>2004-02-27 19:37:43 +0000
committerrees <rees@FreeBSD.org>2004-02-27 19:37:43 +0000
commit108fca056b39835d3cd01b13e983771920013184 (patch)
tree5367f6ef23a6fc409270d072b51ea77d8121749d /sys/nfs4client/nfs4_vfsops.c
parent74ac2d2c4d1597c12027af700def585763cff043 (diff)
downloadFreeBSD-src-108fca056b39835d3cd01b13e983771920013184.zip
FreeBSD-src-108fca056b39835d3cd01b13e983771920013184.tar.gz
NFSv4 fixes from Connectathon 2004:
remove unused pid field of file context struct map nfs4 error codes to errnos eliminate redundant code from nfs4_request use zero stateid on setattr that doesn't set file size use same clientid on all mounts until reboot invalidate dirty bufs in nfs4_close, to play it safe open file for writing if truncating and it's not already open Approved by: alfred
Diffstat (limited to 'sys/nfs4client/nfs4_vfsops.c')
-rw-r--r--sys/nfs4client/nfs4_vfsops.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/nfs4client/nfs4_vfsops.c b/sys/nfs4client/nfs4_vfsops.c
index 550a31a..ba03cc8 100644
--- a/sys/nfs4client/nfs4_vfsops.c
+++ b/sys/nfs4client/nfs4_vfsops.c
@@ -770,7 +770,7 @@ nfs4_do_setclientid(struct nfsmount *nmp, struct ucred *cred)
struct route ro;
char *ipsrc = NULL, uaddr[24], name[24];
int try = 0;
- static int seq;
+ static unsigned long seq;
int error;
#ifndef NFS4_USE_RPCCLNT
@@ -784,7 +784,7 @@ nfs4_do_setclientid(struct nfsmount *nmp, struct ucred *cred)
/* Try not to re-use clientids */
if (seq == 0)
- seq = time_second & 0xffffff;
+ seq = time_second;
#ifdef NFS4_USE_RPCCLNT
scid.cb_netid = (nmp->nm_rpcclnt.rc_sotype == SOCK_STREAM) ? "tcp" : "udp";
@@ -811,7 +811,7 @@ nfs4_do_setclientid(struct nfsmount *nmp, struct ucred *cred)
RTFREE(ro.ro_rt);
try_again:
- sprintf(name, "%s-%d", ipsrc, seq++);
+ sprintf(name, "%s-%d", ipsrc, (int) ((seq + try) % 1000000L));
scid.namelen = strlen(name);
scid.name = name;
nfs_v4initcompound(&cp);
OpenPOWER on IntegriCloud