summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/nfs/nfs_serv.c20
-rw-r--r--sys/nfsserver/nfs_serv.c20
2 files changed, 28 insertions, 12 deletions
diff --git a/sys/nfs/nfs_serv.c b/sys/nfs/nfs_serv.c
index 405e437..d535483 100644
--- a/sys/nfs/nfs_serv.c
+++ b/sys/nfs/nfs_serv.c
@@ -133,6 +133,8 @@ extern struct nfsstats nfsstats;
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
int nfsrvw_procrastinate_v3 = 0;
+static struct timeval nfsver = { 0 };
+
SYSCTL_DECL(_vfs_nfs);
static int nfs_async;
@@ -1192,8 +1194,10 @@ nfsrv_write(nfsd, slp, procp, mrq)
* but it may make the values more human readable,
* for debugging purposes.
*/
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
@@ -1478,8 +1482,10 @@ loop1:
* but it may make the values more human readable,
* for debugging purposes.
*/
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(&va, fp);
@@ -3681,8 +3687,10 @@ nfsrv_commit(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft);
if (!error) {
nfsm_build(tl, u_int32_t *, NFSX_V3WRITEVERF);
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
error = 0;
}
diff --git a/sys/nfsserver/nfs_serv.c b/sys/nfsserver/nfs_serv.c
index 405e437..d535483 100644
--- a/sys/nfsserver/nfs_serv.c
+++ b/sys/nfsserver/nfs_serv.c
@@ -133,6 +133,8 @@ extern struct nfsstats nfsstats;
int nfsrvw_procrastinate = NFS_GATHERDELAY * 1000;
int nfsrvw_procrastinate_v3 = 0;
+static struct timeval nfsver = { 0 };
+
SYSCTL_DECL(_vfs_nfs);
static int nfs_async;
@@ -1192,8 +1194,10 @@ nfsrv_write(nfsd, slp, procp, mrq)
* but it may make the values more human readable,
* for debugging purposes.
*/
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(vap, fp);
@@ -1478,8 +1482,10 @@ loop1:
* but it may make the values more human readable,
* for debugging purposes.
*/
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
nfsm_build(fp, struct nfs_fattr *, NFSX_V2FATTR);
nfsm_srvfillattr(&va, fp);
@@ -3681,8 +3687,10 @@ nfsrv_commit(nfsd, slp, procp, mrq)
nfsm_srvwcc_data(for_ret, &bfor, aft_ret, &aft);
if (!error) {
nfsm_build(tl, u_int32_t *, NFSX_V3WRITEVERF);
- *tl++ = txdr_unsigned(boottime.tv_sec);
- *tl = txdr_unsigned(boottime.tv_usec);
+ if (nfsver.tv_sec == 0)
+ nfsver = boottime;
+ *tl++ = txdr_unsigned(nfsver.tv_sec);
+ *tl = txdr_unsigned(nfsver.tv_usec);
} else {
error = 0;
}
OpenPOWER on IntegriCloud