Commit c0ed4405 authored by Yunlei He's avatar Yunlei He Committed by Jaegeuk Kim

f2fs: fix a missing size change in f2fs_setattr

This patch fix a missing size change in f2fs_setattr
Signed-off-by: default avatarYunlei He <heyunlei@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 5eba8c5d
...@@ -677,6 +677,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -677,6 +677,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
{ {
struct inode *inode = d_inode(dentry); struct inode *inode = d_inode(dentry);
int err; int err;
bool size_changed = false;
err = setattr_prepare(dentry, attr); err = setattr_prepare(dentry, attr);
if (err) if (err)
...@@ -707,6 +708,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -707,6 +708,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
} }
inode->i_mtime = inode->i_ctime = current_time(inode); inode->i_mtime = inode->i_ctime = current_time(inode);
} }
size_changed = true;
} }
__setattr_copy(inode, attr); __setattr_copy(inode, attr);
...@@ -719,8 +722,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) ...@@ -719,8 +722,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
} }
} }
/* update attributes only */ /* file size may changed here */
f2fs_mark_inode_dirty_sync(inode, false); f2fs_mark_inode_dirty_sync(inode, size_changed);
/* inode change will produce dirty node pages flushed by checkpoint */ /* inode change will produce dirty node pages flushed by checkpoint */
f2fs_balance_fs(F2FS_I_SB(inode), true); f2fs_balance_fs(F2FS_I_SB(inode), true);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment