modifying a mmap()-ed file does not update its timestamps
The following is based on a review of the illumos code and on a similar problem reported for FreeBSD where the relevant code is different.
Looking at this block of code http://src.illumos.org/source/xref/illumos-gate/usr/src/uts/common/fs/zfs/zfs_vnops.c#4187 I see code to set up an sa_bulk_attr_t object, I see code to set up mtime and ctime values, but I do not see code to actually apply the attributes...
I would expect there to be a call to sa_bulk_update(), there is such a call in zfs_write() for instance.
Updated by Andriy Gapon almost 4 years ago
A simple demonstration program is attached.
$ cc mmap_write.c -o mmap_write $ ./mmap_write tttttt press enter to update the file, 'q' to exit mtime = 1447249875 mtime = 1447249875 mtime = 1447249875 mtime = 1447249875 q
Updated by Electric Monk over 2 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 80e10fd0d22bbf0d18bfdae035e06f44c68ae8e6 Author: Andriy Gapon <email@example.com> Date: 2017-02-01T05:09:50.000Z 5379 modifying a mmap()-ed file does not update its timestamps Reviewed by: Matthew Ahrens <firstname.lastname@example.org> Reviewed by: Prashanth Sreenivasa <email@example.com> Reviewed by: Dan McDonald <firstname.lastname@example.org> Approved by: Gordon Ross <email@example.com>