Project

General

Profile

Bug #5379

modifying a mmap()-ed file does not update its timestamps

Added by Andriy Gapon almost 5 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
zfs - Zettabyte File System
Start date:
2014-12-02
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage

Description

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.


Files

mmap_write.c (1.42 KB) mmap_write.c demo Andriy Gapon, 2015-11-11 01:53 PM

History

#1

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

#2

Updated by Electric Monk over 2 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit 80e10fd0d22bbf0d18bfdae035e06f44c68ae8e6

commit  80e10fd0d22bbf0d18bfdae035e06f44c68ae8e6
Author: Andriy Gapon <andriy.gapon@clusterhq.com>
Date:   2017-02-01T05:09:50.000Z

    5379 modifying a mmap()-ed file does not update its timestamps
    Reviewed by: Matthew Ahrens <mahrens@delphix.com>
    Reviewed by: Prashanth Sreenivasa <pks@delphix.com>
    Reviewed by: Dan McDonald <danmcd@omniti.com>
    Approved by: Gordon Ross <gordon.w.ross@gmail.com>

Also available in: Atom PDF