diff --git a/sys/nfsserver/nfs_srvsubs.c b/sys/nfsserver/nfs_srvsubs.c index 375a1d20c2bf..2e6d8dd8337c 100644 --- a/sys/nfsserver/nfs_srvsubs.c +++ b/sys/nfsserver/nfs_srvsubs.c @@ -1399,6 +1399,7 @@ int nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos) { u_int32_t *tl; + int toclient = 0; NFSD_LOCK_DONTCARE(); @@ -1447,9 +1448,11 @@ nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos) if (tl == NULL) return EBADRPC; fxdr_nfsv3time(tl, &(a)->va_atime); + toclient = 1; break; case NFSV3SATTRTIME_TOSERVER: getnanotime(&(a)->va_atime); + a->va_vaflags |= VA_UTIMES_NULL; break; } tl = nfsm_dissect_xx_nonblock(NFSX_UNSIGNED, md, dpos); @@ -1461,9 +1464,12 @@ nfsm_srvsattr_xx(struct vattr *a, struct mbuf **md, caddr_t *dpos) if (tl == NULL) return EBADRPC; fxdr_nfsv3time(tl, &(a)->va_mtime); + a->va_vaflags &= ~VA_UTIMES_NULL; break; case NFSV3SATTRTIME_TOSERVER: getnanotime(&(a)->va_mtime); + if (toclient == 0) + a->va_vaflags |= VA_UTIMES_NULL; break; } return 0;