]> Pileus Git - ~andy/linux/blobdiff - fs/btrfs/inode.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
[~andy/linux] / fs / btrfs / inode.c
index b1314300d9fcfd3f2c563ad91182d3584305c664..514b291b135405dd1fbd21f9a8e4edc1b161f5af 100644 (file)
@@ -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
         * 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) {
                truncate_pagecache(inode, newsize);