]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: fix mtime update in nodelalloc mode
authorTheodore Ts'o <tytso@mit.edu>
Mon, 1 Oct 2012 03:04:56 +0000 (23:04 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Mon, 1 Oct 2012 03:04:56 +0000 (23:04 -0400)
commit216103697ea2a13ad26b9d87b433e06a456407dc
tree56283acb90542bd4c97336ca1869279800135b73
parent11ce03406031139a3a525cc796911242353f60fb
ext4: fix mtime update in nodelalloc mode

Commits 65d54333c04c and 7a4c20e10aa9 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>
Cc: stable@vger.kernel.org
fs/buffer.c
fs/ext4/inode.c
fs/nilfs2/file.c