mirror of
https://github.com/torvalds/linux.git
synced 2026-06-08 06:25:52 +02:00
f2fs: fix a missing size change in f2fs_setattr
commit c0ed4405a9 upstream.
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>
This commit is contained in:
parent
f913880bf2
commit
cc0b17f6cc
|
|
@ -678,6 +678,7 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
{
|
||||
struct inode *inode = d_inode(dentry);
|
||||
int err;
|
||||
bool size_changed = false;
|
||||
|
||||
err = inode_change_ok(inode, attr);
|
||||
if (err)
|
||||
|
|
@ -708,6 +709,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
}
|
||||
inode->i_mtime = inode->i_ctime = current_time(inode);
|
||||
}
|
||||
|
||||
size_changed = true;
|
||||
}
|
||||
|
||||
__setattr_copy(inode, attr);
|
||||
|
|
@ -720,8 +723,8 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr)
|
|||
}
|
||||
}
|
||||
|
||||
/* update attributes only */
|
||||
f2fs_mark_inode_dirty_sync(inode, false);
|
||||
/* file size may changed here */
|
||||
f2fs_mark_inode_dirty_sync(inode, size_changed);
|
||||
|
||||
/* inode change will produce dirty node pages flushed by checkpoint */
|
||||
f2fs_balance_fs(F2FS_I_SB(inode), true);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user