From: Huang Ying Date: Sat, 12 Jul 2014 12:10:00 +0000 (+0800) Subject: f2fs: add f2fs_balance_fs for direct IO X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=79e35dc3c23dd2ac9f8681361026c82b71a0b006;p=linux-beck.git 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: Huang, Ying Signed-off-by: Jaegeuk Kim --- diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index 05154d6de49a..c77c66723d70 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -626,8 +626,10 @@ static int __get_data_block(struct inode *inode, sector_t iblock, if (check_extent_cache(inode, pgofs, bh_result)) goto out; - if (create) + if (create) { + f2fs_balance_fs(sbi); f2fs_lock_op(sbi); + } /* When reading holes, we need its node page */ set_new_dnode(&dn, inode, NULL, NULL, 0);