Blob Blame History Raw
From 907fa893258ba6076f5fff32900a461decb9e8c5 Mon Sep 17 00:00:00 2001
From: Namjae Jeon <namjae.jeon@samsung.com>
Date: Fri, 22 May 2020 08:10:10 +0900
Subject: [PATCH] exfat: add the dummy mount options to be backward compatible with staging/exfat
Git-commit: 907fa893258ba6076f5fff32900a461decb9e8c5
Patch-mainline: v5.7-rc7
References: bsc#1182989

[ backport note: __fsparam() lines are adjusted to fit with the old 5.3
  syntax -- tiwai ]

As Ubuntu and Fedora release new version used kernel version equal to or
higher than v5.4, They started to support kernel exfat filesystem.

Linus reported a mount error with new version of exfat on Fedora:

        exfat: Unknown parameter 'namecase'

This is because there is a difference in mount option between old
staging/exfat and new exfat.  And utf8, debug, and codepage options as
well as namecase have been removed from new exfat.

This patch add the dummy mount options as deprecated option to be
backward compatible with old one.

Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Namjae Jeon <namjae.jeon@samsung.com>
Cc: Matthew Wilcox <willy@infradead.org>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Eric Sandeen <sandeen@sandeen.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Acked-by: Takashi Iwai <tiwai@suse.de>

---
 fs/exfat/super.c |   15 +++++++++++++++
 1 file changed, 15 insertions(+)

--- a/fs/exfat/super.c
+++ b/fs/exfat/super.c
@@ -212,6 +212,12 @@ enum {
 	Opt_errors,
 	Opt_discard,
 	Opt_time_offset,
+
+	/* Deprecated options */
+	Opt_utf8,
+	Opt_debug,
+	Opt_namecase,
+	Opt_codepage,
 };
 
 static const struct fs_parameter_spec exfat_param_specs[] = {
@@ -225,6 +231,10 @@ static const struct fs_parameter_spec ex
 	fsparam_enum("errors",			Opt_errors),
 	fsparam_flag("discard",			Opt_discard),
 	fsparam_s32("time_offset",		Opt_time_offset),
+	__fsparam(fs_param_is_flag, "utf8",	Opt_utf8, fs_param_deprecated),
+	__fsparam(fs_param_is_flag, "debug",	Opt_debug, fs_param_deprecated),
+	__fsparam(fs_param_is_u32, "namecase",	Opt_namecase, fs_param_deprecated),
+	__fsparam(fs_param_is_u32, "codepage",	Opt_codepage, fs_param_deprecated),
 	{}
 };
 
@@ -292,6 +302,11 @@ static int exfat_parse_param(struct fs_c
 			return -EINVAL;
 		opts->time_offset = result.int_32;
 		break;
+	case Opt_utf8:
+	case Opt_debug:
+	case Opt_namecase:
+	case Opt_codepage:
+		break;
 	default:
 		return -EINVAL;
 	}