diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 578bc7bcaa13b724c8be8a36a026379501213164..5e3e1674d4e8325d00114cf2907e750b5887c950 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -694,7 +694,6 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) err = f2fs_truncate(inode); if (err) return err; - f2fs_balance_fs(F2FS_I_SB(inode), true); } else { /* * do not trim all blocks after i_size if target size is @@ -723,6 +722,10 @@ int f2fs_setattr(struct dentry *dentry, struct iattr *attr) } f2fs_mark_inode_dirty_sync(inode); + + /* inode change will produce dirty node pages flushed by checkpoint */ + f2fs_balance_fs(F2FS_I_SB(inode), true); + return err; }