diff options
-rw-r--r-- | sys/nfs/nfs_vnops.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sys/nfs/nfs_vnops.c b/sys/nfs/nfs_vnops.c index 88665f9a3ef..21d62b8104c 100644 --- a/sys/nfs/nfs_vnops.c +++ b/sys/nfs/nfs_vnops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: nfs_vnops.c,v 1.183 2020/06/24 22:03:44 cheloha Exp $ */ +/* $OpenBSD: nfs_vnops.c,v 1.184 2020/09/27 16:40:44 matthieu Exp $ */ /* $NetBSD: nfs_vnops.c,v 1.62.4.1 1996/07/08 20:26:52 jtc Exp $ */ /* @@ -1414,6 +1414,7 @@ nfs_create(void *v) struct componentname *cnp = ap->a_cnp; struct nfsv2_sattr *sp; struct nfsm_info info; + struct timespec ts; u_int32_t *tl; int32_t t1; struct nfsnode *np = NULL; @@ -1486,8 +1487,14 @@ nfsmout: fmode &= ~O_EXCL; goto again; } - } else if (info.nmi_v3 && (fmode & O_EXCL)) + } else if (info.nmi_v3 && (fmode & O_EXCL)) { + getnanotime(&ts); + if (vap->va_atime.tv_sec == VNOVAL) + vap->va_atime = ts; + if (vap->va_mtime.tv_sec == VNOVAL) + vap->va_mtime = ts; error = nfs_setattrrpc(newvp, vap, cnp->cn_cred, cnp->cn_proc); + } if (!error) { if (cnp->cn_flags & MAKEENTRY) nfs_cache_enter(dvp, newvp, cnp); |