|
@@ -4354,8 +4354,12 @@ static int btrfs_setsize(struct inode *inode, struct iattr *attr)
|
|
* these flags set. For all other operations the VFS set these flags
|
|
* these flags set. For all other operations the VFS set these flags
|
|
* explicitly if it wants a timestamp update.
|
|
* explicitly if it wants a timestamp update.
|
|
*/
|
|
*/
|
|
- if (newsize != oldsize && (!(mask & (ATTR_CTIME | ATTR_MTIME))))
|
|
|
|
- inode->i_ctime = inode->i_mtime = current_fs_time(inode->i_sb);
|
|
|
|
|
|
+ if (newsize != oldsize) {
|
|
|
|
+ inode_inc_iversion(inode);
|
|
|
|
+ if (!(mask & (ATTR_CTIME | ATTR_MTIME)))
|
|
|
|
+ inode->i_ctime = inode->i_mtime =
|
|
|
|
+ current_fs_time(inode->i_sb);
|
|
|
|
+ }
|
|
|
|
|
|
if (newsize > oldsize) {
|
|
if (newsize > oldsize) {
|
|
truncate_pagecache(inode, newsize);
|
|
truncate_pagecache(inode, newsize);
|