kernel - Try to fix delayed mtime updates on SHARED+RW maps again
commitfa4a12c408e7819a51670d15087aadbf10659890
authorMatthew Dillon <dillon@apollo.backplane.com>
Wed, 14 Feb 2018 07:02:18 +0000 (13 23:02 -0800)
committerMatthew Dillon <dillon@apollo.backplane.com>
Wed, 14 Feb 2018 07:02:18 +0000 (13 23:02 -0800)
tree04ea843a1cb0e50c04053aa2ee9f943262fd6e83
parent6f5aaa27db0f03fb313ea46e1186e7d36cdcb1b6
kernel - Try to fix delayed mtime updates on SHARED+RW maps again

* Attempt to fix continuing problems with mtime updates related to
  modifications made via SHARED+RW mmap()s.  As evidenced by builds
  under synth sometimes getting confused.

* Don't update vp->v_lastwrite_ts in vop_stdclose().  Instead, update
  the field and set a new flag VLASTWRITETS upon mmap(SHARED+PROT_WRITE)
  or upon mprotect(PROT_WRITE) on a SHARED mmap.

* Clear the flag on any regular write, utimes, or truncation.

* Adjust various filesystems to update mtime from vp->v_lastwrite_ts
  only upon UIO_NOCOPY writes, and only if VLASTWRITETS is set.

  tmpfs, ufs, hammer, hammer2 adjusted.
12 files changed:
sys/kern/vfs_default.c
sys/sys/vnode.h
sys/vfs/hammer/hammer_vnops.c
sys/vfs/hammer2/hammer2_vnops.c
sys/vfs/tmpfs/tmpfs.h
sys/vfs/tmpfs/tmpfs_subr.c
sys/vfs/tmpfs/tmpfs_vnops.c
sys/vfs/ufs/inode.h
sys/vfs/ufs/ufs_readwrite.c
sys/vfs/ufs/ufs_vnops.c
sys/vm/vm_map.c
sys/vm/vm_mmap.c