aboutsummaryrefslogtreecommitdiff
path: root/fs/nilfs2
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2012-09-30 23:04:56 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-10-13 05:50:25 +0900
commit92b77229ee73413c1ebfe793ed0085eb1ff794f1 (patch)
tree6896a462b0634196c3dbf6d5d5751e4e0cd43d5a /fs/nilfs2
parent34414b2bf58b95110bf8ccef77d66c05de9e923c (diff)
ext4: fix mtime update in nodelalloc mode
commit 041bbb6d369811e948ae01f3d00414264076be35 upstream. Commits 5e8830dc85d0 and 41c4d25f78c0 introduced a regression into v3.6-rc1 for ext4 in nodealloc mode, such that mtime updates would not take place for files modified via mmap if the page was already in the page cache. This would also affect ext3 file systems mounted using the ext4 file system driver. The problem was that ext4_page_mkwrite() had a shortcut which would avoid calling __block_page_mkwrite() under some circumstances, and the above two commit transferred the responsibility of calling file_update_time() to __block_page_mkwrite --- which woudln't get called in some circumstances. Since __block_page_mkwrite() only has three callers, block_page_mkwrite(), ext4_page_mkwrite, and nilfs_page_mkwrite(), the best way to solve this is to move the responsibility for calling file_update_time() to its caller. This problem was found via xfstests #215 with a file system mounted with -o nodelalloc. Signed-off-by: "Theodore Ts'o" <tytso@mit.edu> Reviewed-by: Jan Kara <jack@suse.cz> Cc: KONISHI Ryusuke <konishi.ryusuke@lab.ntt.co.jp> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/nilfs2')
-rw-r--r--fs/nilfs2/file.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nilfs2/file.c b/fs/nilfs2/file.c
index a4d56ac02e6..5b387a4c293 100644
--- a/fs/nilfs2/file.c
+++ b/fs/nilfs2/file.c
@@ -116,6 +116,7 @@ static int nilfs_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
if (unlikely(ret))
goto out;
+ file_update_time(vma->vm_file);
ret = __block_page_mkwrite(vma, vmf, nilfs_get_block);
if (ret) {
nilfs_transaction_abort(inode->i_sb);