summaryrefslogtreecommitdiff
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-10-14 13:30:31 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-11-23 12:11:05 -0800
commit15d04354555fdfe8005e1365009e349148fb5f90 (patch)
tree87ca705711f58273555ff0188967a905a7966aa8 /fs/f2fs
parentb9610bdfcbdbb6017802ec6d1e073f445c98157d (diff)
downloadlwn-15d04354555fdfe8005e1365009e349148fb5f90.tar.gz
lwn-15d04354555fdfe8005e1365009e349148fb5f90.zip
f2fs: call f2fs_balance_fs for setattr
If inode becomes dirty, we need to check the # of dirty inodes whether or not further checkpoint would be required. Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c
index 578bc7bcaa13..5e3e1674d4e8 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;
}