From: huangzq2 Date: Thu, 13 Jun 2019 06:34:20 +0000 (+0800) Subject: fix the f2fs mount failed issue in low memory case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=502d3293efb3c20829ebedc73285a5899a787ab6;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git fix the f2fs mount failed issue in low memory case On the RACK test, the SDcard often mount failed becuase of the page allocation failure. After checked with f2fs owner, we can use kvzmalloc to alloc non-continuous memory in case continuous memory allocation failed. Change-Id: Ifd83e8b9a6bff241ed851007a3b7aec49b413eb3 Signed-off-by: huangzq2 Reviewed-on: https://gerrit.mot.com/1370212 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Wei Deng Reviewed-by: Xiangpo Zhao Submit-Approved: Jira Key --- diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index a4290c79fb24..6edd9eb211e3 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -2776,7 +2776,7 @@ static int init_free_nid_cache(struct f2fs_sb_info *sbi) struct f2fs_nm_info *nm_i = NM_I(sbi); int i; - nm_i->free_nid_bitmap = f2fs_kzalloc(sbi, nm_i->nat_blocks * + nm_i->free_nid_bitmap = f2fs_kvzalloc(sbi, nm_i->nat_blocks * sizeof(unsigned char *), GFP_KERNEL); if (!nm_i->free_nid_bitmap) return -ENOMEM; @@ -2883,7 +2883,7 @@ void destroy_node_manager(struct f2fs_sb_info *sbi) for (i = 0; i < nm_i->nat_blocks; i++) kvfree(nm_i->free_nid_bitmap[i]); - kfree(nm_i->free_nid_bitmap); + kvfree(nm_i->free_nid_bitmap); } kvfree(nm_i->free_nid_count);