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 <a22381@motorola.com>
Reviewed-by: Dongliang Yue <yuedl1@motorola.com>
Reviewed-by: Igor Kovalenko <igork@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
zhucc2 2020-04-22 09:36:04 +08:00 • committed by Chuanchun Zhu
commit fd5e126865

View file

@ -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)