Kernel Tree For Xiaomi 11 Lite NE 5G
Go to file
Namjae Jeon 779f03e967 exfat: Avoid allocating upcase table using kcalloc()
The table for Unicode upcase conversion requires an order-5 allocation,
which may fail on a highly-fragmented system:

 pool-udisksd: page allocation failure: order:5,
 mode:0x40dc0(GFP_KERNEL|__GFP_COMP|__GFP_ZERO), nodemask=(null),
 cpuset=/,mems_allowed=0
 CPU: 4 PID: 3756880 Comm: pool-udisksd Tainted: G U
 5.8.10-200.fc32.x86_64 #1
 Hardware name: Dell Inc. XPS 13 9360/0PVG6D, BIOS 2.13.0 11/14/2019
 Call Trace:
  dump_stack+0x6b/0x88
  warn_alloc.cold+0x75/0xd9
  ? _cond_resched+0x16/0x40
  ? __alloc_pages_direct_compact+0x144/0x150
  __alloc_pages_slowpath.constprop.0+0xcfa/0xd30
  ? __schedule+0x28a/0x840
  ? __wait_on_bit_lock+0x92/0xa0
  __alloc_pages_nodemask+0x2df/0x320
  kmalloc_order+0x1b/0x80
  kmalloc_order_trace+0x1d/0xa0
  exfat_create_upcase_table+0x115/0x390 [exfat]
  exfat_fill_super+0x3ef/0x7f0 [exfat]
  ? sget_fc+0x1d0/0x240
  ? exfat_init_fs_context+0x120/0x120 [exfat]
  get_tree_bdev+0x15c/0x250
  vfs_get_tree+0x25/0xb0
  do_mount+0x7c3/0xaf0
  ? copy_mount_options+0xab/0x180
  __x64_sys_mount+0x8e/0xd0
  do_syscall_64+0x4d/0x90
  entry_SYSCALL_64_after_hwframe+0x44/0xa9

Make the driver use vzalloc() to eliminate the issue.

Fixes: 370e812b3ec1 ("exfat: add nls operations")
Cc: stable@vger.kernel.org # v5.7+
Signed-off-by: Artem Labazov <123321artyom@gmail.com>
Reviewed-by: Sungjong Seo <sj1557.seo@samsung.com>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
2020-12-08 12:51:04 +09:00
.travis_cmd_wrapper.pl exfat: add travis-CI build and test support 2020-02-03 22:43:47 +09:00
.travis_get_mainline_kernel exfat: add travis-CI build and test support 2020-02-03 22:43:47 +09:00
.travis.yml exfat: enable generic/452 test 2020-06-17 22:08:38 +09:00
balloc.c exfat: remove EXFAT_SB_DIRTY flag 2020-06-17 22:08:32 +09:00
cache.c exfat: fix use of uninitialized spinlock on error path 2020-10-12 22:56:52 +09:00
dir.c exfat: remove 'rwoffset' in exfat_inode_info 2020-10-12 21:38:48 +09:00
exfat_fs.h exfat: release 5.10.1 version 2020-10-12 23:17:20 +09:00
exfat_raw.h exfat: retain 'VolumeFlags' properly 2020-09-10 09:02:45 +09:00
fatent.c exfat: optimize exfat_zeroed_cluster() 2020-07-03 12:40:21 +09:00
file.c exfat: fix build error with i_blocksize 2020-12-08 12:25:44 +09:00
inode.c exfat: fix use of uninitialized spinlock on error path 2020-10-12 22:56:52 +09:00
Kconfig exfat: initial commit 2020-02-03 21:47:19 +09:00
Makefile exfat: linux 4.16 kernel build support 2020-02-04 09:18:10 +09:00
misc.c exfat: fix build error on 32bit & 4.19 lower kernel version 2020-07-03 12:40:25 +09:00
namei.c exfat: remove useless check in exfat_move_file() 2020-10-12 23:02:49 +09:00
nls.c exfat: Avoid allocating upcase table using kcalloc() 2020-12-08 12:51:04 +09:00
README.md exfat: fix typo 2020-02-10 21:35:58 +09:00
super.c exfat: fix use of uninitialized spinlock on error path 2020-10-12 22:56:52 +09:00

exFAT filesystem

This is the exfat filesystem for support from the linux 4.1 kernel to the latest kernel.

Installing as a stand-alone module

Install prerequisite package for Fedora, RHEL:

	yum install kernel-devel-$(uname -r)

Build step:

	make
	sudo make install

To load the driver manually, run this as root:

	modprobe exfat

Installing as a part of the kernel

  1. Let's take [linux] as the path to your kernel source dir.
	cd [linux]
	cp -ar exfat [linux]/fs/
  1. edit [linux]/fs/Kconfig
	source "fs/fat/Kconfig"
	+source "fs/exfat/Kconfig"
	source "fs/ntfs/Kconfig"
  1. edit [linux]/fs/Makefile
	obj-$(CONFIG_FAT_FS)          += fat/
	+obj-$(CONFIG_EXFAT_FS)       += exfat/
	obj-$(CONFIG_BFS_FS)          += bfs/
  1. make menuconfig and set exfat
	File systems  --->
		DOS/FAT/NT Filesystems  --->
			<M> exFAT filesystem support
			(utf8) Default iocharset for exFAT

build your kernel