Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland...
[cascardo/linux.git] / fs / ext2 / inode.c
index 1921443..3675088 100644 (file)
@@ -1552,7 +1552,7 @@ int ext2_setattr(struct dentry *dentry, struct iattr *iattr)
                if (error)
                        return error;
        }
-       if (iattr->ia_valid & ATTR_SIZE) {
+       if (iattr->ia_valid & ATTR_SIZE && iattr->ia_size != inode->i_size) {
                error = ext2_setsize(inode, iattr->ia_size);
                if (error)
                        return error;