aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYunlei He <heyunlei@huawei.com>2016-12-11 02:35:15 -0500
committerJaegeuk Kim <jaegeuk@kernel.org>2016-12-12 14:09:05 -0500
commitc0ed4405a99ec9be2a0f062eaafc002d8d26c99f (patch)
treeb4804b432f69b2de925fe08abb719e7e74eda669
parent5eba8c5d1fb3af28b2073ba5228d4998196c1bcc (diff)
f2fs: fix a missing size change in f2fs_setattr
This patch fix a missing size change in f2fs_setattr Signed-off-by: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
-rw-r--r--fs/f2fs/file.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 4c87261c1cd2..383b5c29f46b 100644
--- a/fs/f2fs/file.c
+++ b/fs/f2fs/file.c
@@ -677,6 +677,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
677{ 677{
678 struct inode *inode = d_inode(dentry); 678 struct inode *inode = d_inode(dentry);
679 int err; 679 int err;
680 bool size_changed = false;
680 681
681 err = setattr_prepare(dentry, attr); 682 err = setattr_prepare(dentry, attr);
682 if (err) 683 if (err)
@@ -707,6 +708,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
707 } 708 }
708 inode->i_mtime = inode->i_ctime = current_time(inode); 709 inode->i_mtime = inode->i_ctime = current_time(inode);
709 } 710 }
711
712 size_changed = true;
710 } 713 }
711 714
712 __setattr_copy(inode, attr); 715 __setattr_copy(inode, attr);
@@ -719,8 +722,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
719 } 722 }
720 } 723 }
721 724
722 /* update attributes only */ 725 /* file size may changed here */
723 f2fs_mark_inode_dirty_sync(inode, false); 726 f2fs_mark_inode_dirty_sync(inode, size_changed);
724 727
725 /* inode change will produce dirty node pages flushed by checkpoint */ 728 /* inode change will produce dirty node pages flushed by checkpoint */
726 f2fs_balance_fs(F2FS_I_SB(inode), true); 729 f2fs_balance_fs(F2FS_I_SB(inode), true);