Kernel sources for Moto G9 (Play) (Guamp)
Find a file
Takashi Iwai 3cc661ccd5 exfat: Return ENAMETOOLONG consistently for oversized paths
LTP has a test for oversized file path renames and it expects the
return value to be ENAMETOOLONG.  However, exfat returns EINVAL
unexpectedly in some cases, hence LTP test fails.  The further
investigation indicated that the problem happens only when iocharset
isn't set to utf8.

The difference comes from that, in the case of utf8,
exfat_utf8_to_utf16() returns the error -ENAMETOOLONG directly and
it's treated as the final error code.  Meanwhile, on other iocharsets,
exfat_nls_to_ucs2() returns the max path size but it sets
NLS_NAME_OVERLEN to lossy flag instead; the caller side checks only
whether lossy flag is set or not, resulting in always -EINVAL
unconditionally.

This patch aligns the return code for both cases by checking the lossy
flag bit and returning ENAMETOOLONG when NLS_NAME_OVERLEN bit is set.

BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1201725
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
2022-07-29 10:24:21 +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
balloc.c exfat: further fix 'fatal_signal_pending' undeclared 2022-05-18 13:43:00 +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 argument 'sector' from exfat_get_dentry() 2021-12-16 21:30:53 +09:00
exfat_fs.h exfat: reuse __exfat_write_inode() to update directory entry 2022-07-21 15:40:30 +09:00
exfat_raw.h exfat: fix shift-out-of-bounds in exfat_fill_super() 2021-02-01 10:35:05 +09:00
fatent.c exfat: directly call filemap_write_and_wait_range() on < 5.19 kernel 2022-05-19 22:43:01 +09:00
file.c exfat: simplified by using round_up() 2022-07-22 11:43:56 +09:00
inode.c exfat: simplified by using round_up() 2022-07-22 11:43:56 +09:00
Kconfig exfat: initial commit 2020-02-03 21:47:19 +09:00
Makefile exfat: fix typo in Makefile 2021-10-14 22:24:23 -07:00
misc.c exfat: fix write failure on kernels prior to 4.8. 2022-05-14 08:27:13 +09:00
namei.c exfat: Return ENAMETOOLONG consistently for oversized paths 2022-07-29 10:24:21 +09:00
nls.c exfat: remove argument 'sector' from exfat_get_dentry() 2021-12-16 21:30:53 +09:00
README.md exfat: fix typo 2020-02-10 21:35:58 +09:00
super.c exfat: simplified by using round_up() 2022-07-22 11:43:56 +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