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)
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


No differences found