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 about 5 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 almost 4 years ago
- Status changed from New to Closed
- % Done changed from 0 to 100
commit 80e10fd0d22bbf0d18bfdae035e06f44c68ae8e6 Author: Andriy Gapon <firstname.lastname@example.org> Date: 2017-02-01T05:09:50.000Z 5379 modifying a mmap()-ed file does not update its timestamps Reviewed by: Matthew Ahrens <email@example.com> Reviewed by: Prashanth Sreenivasa <firstname.lastname@example.org> Reviewed by: Dan McDonald <email@example.com> Approved by: Gordon Ross <firstname.lastname@example.org>