From: Brian Behlendorf Date: Tue, 4 Dec 2012 20:11:02 +0000 (-0800) Subject: Preserve inode mtime/ctime in .writepage() X-Git-Url: https://git.camperquake.de/gitweb.cgi?a=commitdiff_plain;h=d3aa3ea96e02547166563bbd60bc8581567a140a;hp=d3aa3ea96e02547166563bbd60bc8581567a140a;p=zfs.git 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 Signed-off-by: Richard Yao Signed-off-by: Brian Behlendorf Closes #764 ---