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

Commit 79e35dc3 authored by Huang Ying's avatar Huang Ying Committed by Jaegeuk Kim
Browse files

f2fs: add f2fs_balance_fs for direct IO



Otherwise, if a large amount of direct IO writes were done, the
segment allocation may be failed because no enough segments are gced.

Changes:

v2: add f2fs_balance_fs into __get_data_block instead of f2fs_direct_IO.

Signed-off-by: default avatarHuang, Ying <ying.huang@intel.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent f1121ab0
Loading
Loading
Loading
Loading
+3 −1
Original line number Original line Diff line number Diff line
@@ -626,8 +626,10 @@ static int __get_data_block(struct inode *inode, sector_t iblock,
	if (check_extent_cache(inode, pgofs, bh_result))
	if (check_extent_cache(inode, pgofs, bh_result))
		goto out;
		goto out;


	if (create)
	if (create) {
		f2fs_balance_fs(sbi);
		f2fs_lock_op(sbi);
		f2fs_lock_op(sbi);
	}


	/* When reading holes, we need its node page */
	/* When reading holes, we need its node page */
	set_new_dnode(&dn, inode, NULL, NULL, 0);
	set_new_dnode(&dn, inode, NULL, NULL, 0);