Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 92c9dec3 authored by Jaegeuk Kim's avatar Jaegeuk Kim Committed by Jaegeuk Kim
Browse files

f2fs: call f2fs_balance_fs for setattr



commit 15d04354555fdfe8005e1365009e349148fb5f90 upstream.

If inode becomes dirty, we need to check the # of dirty inodes whether or not
further checkpoint would be required.

Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent beb74f77
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -695,7 +695,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
@@ -724,6 +723,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;
}