f2fs: fix time update in case of f2fs fallocate
authorNamjae Jeon <namjae.jeon@samsung.com>
Sun, 30 Dec 2012 05:52:37 +0000 (14:52 +0900)
committerJaegeuk Kim <jaegeuk.kim@samsung.com>
Fri, 4 Jan 2013 00:42:59 +0000 (09:42 +0900)
After doing a punch hole or expanding inode doing fallocation.
The change and modification time are not update for the file.
So, update time after no issue is observed in fallocate.

Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: Amit Sahrawat <a.sahrawat@samsung.com>
Signed-off-by: Jaegeuk Kim <jaegeuk.kim@samsung.com>
fs/f2fs/file.c

index 7f9ea9271ebeaa4e1da9440758c5fe6c2cee62f3..88593c5e743c68a53c6c463ace9668ee54329348 100644 (file)
@@ -545,6 +545,11 @@ static long f2fs_fallocate(struct file *file, int mode,
        else
                ret = expand_inode_data(inode, offset, len, mode);
 
+       if (!ret) {
+               inode->i_mtime = inode->i_ctime = CURRENT_TIME;
+               mark_inode_dirty(inode);
+       }
+
        f2fs_balance_fs(sbi);
        return ret;
 }