From fd5e12686529a726f798e8a85322e569dd35bf70 Mon Sep 17 00:00:00 2001 From: zhucc2 Date: Wed, 22 Apr 2020 09:36:04 +0800 Subject: [PATCH] exfat: use kvzalloc instead kzalloc in exfat_fill_super(). kzalloc maybe fail when memory fragmented, there is not enough contiguous memory to used. 04-17 02:19:20.788 672 11313 D vold : File system checking finished. No errors found. 04-17 02:19:20.788 672 11313 D vold : 04-17 02:19:20.788 672 11313 I vold : Check OK 04-17 02:19:20.816 672 11313 E vold : Mount failed; attempting read-only: Out of memory 04-17 02:19:20.818 672 11313 E vold : public:8,97 failed to mount /dev/block/vold/public:8,97: Out of memory Binder : 672_7: page allocation failure: order:4, mode:0x60c0c0 (GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null) Change-Id: I7bb92c672bdf2b2f777871d5f12f793b34d36b7f Reviewed-on: https://gerrit.mot.com/1539365 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Shi-Yong Li Reviewed-by: Dongliang Yue Reviewed-by: Igor Kovalenko Submit-Approved: Jira Key --- fs/exfat/exfat_super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/exfat/exfat_super.c b/fs/exfat/exfat_super.c index 6d178c1c5034..5a3b0826b975 100644 --- a/fs/exfat/exfat_super.c +++ b/fs/exfat/exfat_super.c @@ -2079,7 +2079,7 @@ static void exfat_free_super(struct exfat_sb_info *sbi) /* mutex_init is in exfat_fill_super function. only for 3.7+ */ mutex_destroy(&sbi->s_lock); #endif - kfree(sbi); + kvfree(sbi); } static void exfat_put_super(struct super_block *sb) @@ -2506,7 +2506,7 @@ static int exfat_fill_super(struct super_block *sb, void *data, int silent) * the filesystem, since we're only just about to mount * it and have no inodes etc active! */ - sbi = kzalloc(sizeof(struct exfat_sb_info), GFP_KERNEL); + sbi = kvzalloc(sizeof(struct exfat_sb_info), GFP_KERNEL); if (!sbi) return -ENOMEM; #if LINUX_VERSION_CODE >= KERNEL_VERSION(3,7,0)