From 98de46168a020893ca0fc768d6a2107d2178fbd6 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Mon, 10 Feb 2020 21:04:14 +0900 Subject: [PATCH 1/4] exfat: enable check exfat filesystem Signed-off-by: Namjae Jeon --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5a50c5c3d6bf..c4a1e79ad976 100644 --- a/.travis.yml +++ b/.travis.yml @@ -70,7 +70,6 @@ script: - sudo losetup /dev/loop21 test.img - sudo mkfs.exfat -c 4 /dev/loop20 - sudo mkfs.exfat -c 4 /dev/loop21 - - sudo make uninstall - cd .. - cd exfat-testsuites/ - tar xzvf xfstests-exfat.tgz > /dev/null From 55bec228982550483ef0823e84ac0c60e97186d1 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Mon, 10 Feb 2020 21:34:19 +0900 Subject: [PATCH 2/4] exfat: update README file Signed-off-by: Namjae Jeon --- README.md | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c70f1aecceb2..25164fd5dee6 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,53 @@ -# exfat -linux-exfat for 4.1 ~ the latest linus-tree +## 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/ +``` + +2. edit [linux]/fs/Kconfig +``` + source "fs/fat/Kconfig" + +source "fs/exfat/Kconfig" + source "fs/ntfs/Kconfig" +``` + +3. edit [linux]/fs/Makefile +``` + obj-$(CONFIG_FAT_FS) += fat/ + +obj-$(CONFIG_EXFAT_FS) += ksmbd/ + obj-$(CONFIG_BFS_FS) += bfs/ +``` +4. make menuconfig and set exfat +``` + File systems ---> + DOS/FAT/NT Filesystems ---> + exFAT filesystem support + (utf8) Default iocharset for exFAT +``` + +build your kernel From 9c905ae9e71ec45ff0363d0712cc10c551b60783 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Mon, 10 Feb 2020 21:35:58 +0900 Subject: [PATCH 3/4] exfat: fix typo Signed-off-by: Namjae Jeon --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 25164fd5dee6..cee3699ed9be 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ To load the driver manually, run this as root: 3. edit [linux]/fs/Makefile ``` obj-$(CONFIG_FAT_FS) += fat/ - +obj-$(CONFIG_EXFAT_FS) += ksmbd/ + +obj-$(CONFIG_EXFAT_FS) += exfat/ obj-$(CONFIG_BFS_FS) += bfs/ ``` 4. make menuconfig and set exfat From dafa5b3b3adf39d01db3123c15b011868559fcb1 Mon Sep 17 00:00:00 2001 From: Namjae Jeon Date: Mon, 10 Feb 2020 21:57:29 +0900 Subject: [PATCH 4/4] exfat: linux 5.6 kernel support Signed-off-by: Namjae Jeon --- super.c | 41 ++++++++++++++++++++++++++++++++++------- 1 file changed, 34 insertions(+), 7 deletions(-) diff --git a/super.c b/super.c index b7f57665fa00..769dcdf4ac10 100644 --- a/super.c +++ b/super.c @@ -249,7 +249,27 @@ enum { Opt_time_offset, }; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct constant_table exfat_param_enums[] = { + { "continue", EXFAT_ERRORS_CONT }, + { "panic", EXFAT_ERRORS_PANIC }, + { "remount-ro", EXFAT_ERRORS_RO }, + {} +}; +#else +static const struct fs_parameter_enum exfat_param_enums[] = { + { Opt_errors, "continue", EXFAT_ERRORS_CONT }, + { Opt_errors, "panic", EXFAT_ERRORS_PANIC }, + { Opt_errors, "remount-ro", EXFAT_ERRORS_RO }, + {} +}; +#endif + +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) +static const struct fs_parameter_spec exfat_parameters[] = { +#else static const struct fs_parameter_spec exfat_param_specs[] = { +#endif fsparam_u32("uid", Opt_uid), fsparam_u32("gid", Opt_gid), fsparam_u32oct("umask", Opt_umask), @@ -257,24 +277,23 @@ static const struct fs_parameter_spec exfat_param_specs[] = { fsparam_u32oct("fmask", Opt_fmask), fsparam_u32oct("allow_utime", Opt_allow_utime), fsparam_string("iocharset", Opt_charset), +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + fsparam_enum("errors", Opt_errors, exfat_param_enums), +#else fsparam_enum("errors", Opt_errors), +#endif fsparam_flag("discard", Opt_discard), fsparam_s32("time_offset", Opt_time_offset), {} }; -static const struct fs_parameter_enum exfat_param_enums[] = { - { Opt_errors, "continue", EXFAT_ERRORS_CONT }, - { Opt_errors, "panic", EXFAT_ERRORS_PANIC }, - { Opt_errors, "remount-ro", EXFAT_ERRORS_RO }, - {} -}; - +#if LINUX_VERSION_CODE <= KERNEL_VERSION(5, 5, 0) static const struct fs_parameter_description exfat_parameters = { .name = "exfat", .specs = exfat_param_specs, .enums = exfat_param_enums, }; +#endif static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param) { @@ -283,7 +302,11 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param) struct fs_parse_result result; int opt; +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + opt = fs_parse(fc, exfat_parameters, param, &result); +#else opt = fs_parse(fc, &exfat_parameters, param, &result); +#endif if (opt < 0) return opt; @@ -893,7 +916,11 @@ static struct file_system_type exfat_fs_type = { .name = "exfat", #if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0) .init_fs_context = exfat_init_fs_context, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(5, 6, 0) + .parameters = exfat_parameters, +#else .parameters = &exfat_parameters, +#endif #else .mount = exfat_fs_mount, #endif