diff options
author | Rick Macklem <rmacklem@FreeBSD.org> | 2021-10-30 23:46:14 +0000 |
---|---|---|
committer | Rick Macklem <rmacklem@FreeBSD.org> | 2021-10-30 23:46:14 +0000 |
commit | ab87c39c257e7130677867f8e5c11a3ec53fa1bc (patch) | |
tree | 02beed21d8114f3135dbd388e39dde51df455aa3 /sys/fs/nfsclient | |
parent | 2be417843a04f25e631e99d5188eb2652b13d80d (diff) | |
download | src-ab87c39c257e7130677867f8e5c11a3ec53fa1bc.tar.gz src-ab87c39c257e7130677867f8e5c11a3ec53fa1bc.zip |
nfscl: Set n_localmodtime in Deallocate
Commit 2be417843a04 added n_localmodtime, which is used by Lookup
and ReaddirPlus to check to see if the file attributes in an RPC
reply might be stale. This patch sets n_localmodtime in Deallocate.
Done as a separate commit, since Deallocate is not in stable/13.
PR: 259071
Reviewed by: asomers
Differential Revision: https://reviews.freebsd.org/D32635
Diffstat (limited to 'sys/fs/nfsclient')
-rw-r--r-- | sys/fs/nfsclient/nfs_clvnops.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sys/fs/nfsclient/nfs_clvnops.c b/sys/fs/nfsclient/nfs_clvnops.c index e8c713086717..f63eadf26a91 100644 --- a/sys/fs/nfsclient/nfs_clvnops.c +++ b/sys/fs/nfsclient/nfs_clvnops.c @@ -3767,6 +3767,7 @@ nfs_deallocate(struct vop_deallocate_args *ap) off_t tlen, mlen; int attrflag, error, ret; bool clipped; + struct timespec ts; error = 0; attrflag = 0; @@ -3809,6 +3810,10 @@ nfs_deallocate(struct vop_deallocate_args *ap) if (error == 0) { NFSCL_DEBUG(4, "dealloc: attrflag=%d na_size=%ju\n", attrflag, (uintmax_t)nfsva.na_size); + nanouptime(&ts); + NFSLOCKNODE(np); + np->n_localmodtime = ts; + NFSUNLOCKNODE(np); if (attrflag != 0) { if ((uint64_t)*ap->a_offset < nfsva.na_size) *ap->a_offset += omin((off_t) |