summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolofo Ramangalahy <Solofo.Ramangalahy@bull.net>2008-04-29 22:00:41 -0400
committerTheodore Ts'o <tytso@mit.edu>2008-04-29 22:00:41 -0400
commitef7377289a1510d638004158e43878643bc75dc5 (patch)
tree4e7cfd27dc9322f0803fe438f63e1f9a2c4fb4cd
parentc83617db76353ff30e825874be2c15c185b95759 (diff)
downloadlinux-ef7377289a1510d638004158e43878643bc75dc5.tar.gz
linux-ef7377289a1510d638004158e43878643bc75dc5.tar.bz2
linux-ef7377289a1510d638004158e43878643bc75dc5.zip
ext4: update ctime and mtime for truncate with extents.
The recently announced "Linux POSIX file system test suite" caught a truncate issue when using extents: mtime and ctime are not updated when truncate is successful. This is the single issue caught with "default" ext4 (mkfs and mount with minimal options). The testsuite does not report failure with -o noextents. With the following patch, all tests of the testsuite pass. Signed-off-by: Solofo Ramangalahy <Solofo.Ramangalahy@bull.net> Signed-off-by: Mingming Cao <cmm@us.ibm.com> Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
-rw-r--r--fs/ext4/extents.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
index a472bc046363..47929c4e3dae 100644
--- a/fs/ext4/extents.c
+++ b/fs/ext4/extents.c
@@ -2809,6 +2809,8 @@ out_stop:
ext4_orphan_del(handle, inode);
up_write(&EXT4_I(inode)->i_data_sem);
+ inode->i_mtime = inode->i_ctime = ext4_current_time(inode);
+ ext4_mark_inode_dirty(handle, inode);
ext4_journal_stop(handle);
}