aboutsummaryrefslogtreecommitdiffstats
path: root/mm/shmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/shmem.c')
-rw-r--r--mm/shmem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mm/shmem.c b/mm/shmem.c
index 7e5030ae18ff..f65f84062db5 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -764,10 +764,11 @@ done2:
764static int shmem_notify_change(struct dentry *dentry, struct iattr *attr) 764static int shmem_notify_change(struct dentry *dentry, struct iattr *attr)
765{ 765{
766 struct inode *inode = dentry->d_inode; 766 struct inode *inode = dentry->d_inode;
767 loff_t newsize = attr->ia_size;
767 int error; 768 int error;
768 769
769 if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)) { 770 if (S_ISREG(inode->i_mode) && (attr->ia_valid & ATTR_SIZE)
770 loff_t newsize = attr->ia_size; 771 && newsize != inode->i_size) {
771 struct page *page = NULL; 772 struct page *page = NULL;
772 773
773 if (newsize < inode->i_size) { 774 if (newsize < inode->i_size) {