nfsrv_rename() should behave like dorenameat() and tell UVM to "flush" a possibly mmap'ed file before calling VOP_RENAME().
ok? Index: nfs/nfs_serv.c =================================================================== RCS file: /cvs/src/sys/nfs/nfs_serv.c,v retrieving revision 1.120 diff -u -p -r1.120 nfs_serv.c --- nfs/nfs_serv.c 11 Mar 2021 13:31:35 -0000 1.120 +++ nfs/nfs_serv.c 4 May 2022 15:29:06 -0000 @@ -1488,6 +1488,9 @@ nfsrv_rename(struct nfsrv_descript *nfsd error = -1; out: if (!error) { + if (tvp) { + (void)uvm_vnp_uncache(tvp); + } error = VOP_RENAME(fromnd.ni_dvp, fromnd.ni_vp, &fromnd.ni_cnd, tond.ni_dvp, tond.ni_vp, &tond.ni_cnd); } else {