Merge tag 'ext4_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso...
[linux-2.6-microblaze.git] / fs / ext4 / inode.c
index fed7ee7..29f1af7 100644 (file)
@@ -4728,6 +4728,14 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
                                error = ext4_orphan_add(handle, inode);
                                orphan = 1;
                        }
+                       /*
+                        * Update c/mtime on truncate up, ext4_truncate() will
+                        * update c/mtime in shrink case below
+                        */
+                       if (!shrink) {
+                               inode->i_mtime = ext4_current_time(inode);
+                               inode->i_ctime = inode->i_mtime;
+                       }
                        down_write(&EXT4_I(inode)->i_data_sem);
                        EXT4_I(inode)->i_disksize = attr->ia_size;
                        rc = ext4_mark_inode_dirty(handle, inode);