]> git.proxmox.com Git - mirror_zfs-debian.git/commit - module/zfs/zfs_vnops.c
Preserve inode mtime/ctime in .writepage()
authorBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 4 Dec 2012 20:11:02 +0000 (12:11 -0800)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 5 Dec 2012 21:00:25 +0000 (13:00 -0800)
commitd3aa3ea96e02547166563bbd60bc8581567a140a
treeb0b5a37e2f44e2835a6cc03e5052bb51d45f89d0
parent53c2ec1d1b3ffdc90c1c6516558e6b4da77c2446
Preserve inode mtime/ctime in .writepage()

When updating a file via mmap()'ed I/O preserve the mtime/ctime
which were updated when the page was made writable by the generic
callback filemap_page_mkwrite().

But more importantly than preserving the exact time add the missing
call to sa_bulk_update().  This ensures that the znode modifications
are written to disk as part of the transaction.  Without this the
inode may mistaken rollback to the previous on-disk znode state.

Additionally, for mmap()'ed znodes explicitly set the atime, mtime,
and ctime on close using the up to date values in the inode.  This
is critical because writepage() may occur after close and on close
we need to ensure the values are correct.

Original-patch-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #764
module/zfs/zfs_vnops.c