[PATCH 06/11] 9p: Push file_update_time() into v9fs_vm_page_mkwrite()

From: Jan Kara
Date: Thu Feb 16 2012 - 08:49:13 EST


CC: Eric Van Hensbergen <ericvh@xxxxxxxxx>
CC: Ron Minnich <rminnich@xxxxxxxxxx>
CC: Latchesar Ionkov <lucho@xxxxxxxxxx>
CC: v9fs-developer@xxxxxxxxxxxxxxxxxxxxx
Signed-off-by: Jan Kara <jack@xxxxxxx>
---
fs/9p/vfs_file.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

BTW: I see you don't check whether the page you locked isn't beyond i_size.
Cannot your code race with truncate? See checks in __block_page_mkwrite()...

diff --git a/fs/9p/vfs_file.c b/fs/9p/vfs_file.c
index fc06fd2..dd6f7ee 100644
--- a/fs/9p/vfs_file.c
+++ b/fs/9p/vfs_file.c
@@ -610,6 +610,9 @@ v9fs_vm_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
p9_debug(P9_DEBUG_VFS, "page %p fid %lx\n",
page, (unsigned long)filp->private_data);

+ /* Update file times before taking page lock */
+ file_update_time(filp);
+
v9inode = V9FS_I(inode);
/* make sure the cache has finished storing the page */
v9fs_fscache_wait_on_page_write(inode, page);
--
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/