linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] exfat: add the dummy mount options to be backward compatible with staging/exfat
@ 2020-05-21 14:05 Namjae Jeon
  2020-05-21 15:44 ` Eric Sandeen
  0 siblings, 1 reply; 4+ messages in thread
From: Namjae Jeon @ 2020-05-21 14:05 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: linux-kernel, torvalds, Namjae Jeon

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 Torvalds reported 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>
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
v2:
 - fix checkpatch.pl warning(Missing Signed-off-by).

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

diff --git a/fs/exfat/super.c b/fs/exfat/super.c
index 0565d5539d57..26b0db5b20de 100644
--- a/fs/exfat/super.c
+++ b/fs/exfat/super.c
@@ -203,6 +203,12 @@ enum {
 	Opt_errors,
 	Opt_discard,
 	Opt_time_offset,
+
+	/* Deprecated options */
+	Opt_utf8,
+	Opt_debug,
+	Opt_namecase,
+	Opt_codepage,
 };
 
 static const struct constant_table exfat_param_enums[] = {
@@ -223,6 +229,10 @@ static const struct fs_parameter_spec exfat_parameters[] = {
 	fsparam_enum("errors",			Opt_errors, exfat_param_enums),
 	fsparam_flag("discard",			Opt_discard),
 	fsparam_s32("time_offset",		Opt_time_offset),
+	fsparam_flag("utf8",			Opt_utf8),
+	fsparam_flag("debug",			Opt_debug),
+	fsparam_u32("namecase",			Opt_namecase),
+	fsparam_u32("codepage",			Opt_codepage),
 	{}
 };
 
@@ -278,6 +288,18 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param)
 			return -EINVAL;
 		opts->time_offset = result.int_32;
 		break;
+	case Opt_utf8:
+		pr_warn("exFAT-fs: 'utf8' mount option is deprecated and has no effect\n");
+		break;
+	case Opt_debug:
+		pr_warn("exFAT-fs: 'debug' mount option is deprecated and has no effect\n");
+		break;
+	case Opt_namecase:
+		pr_warn("exFAT-fs: 'namecase' mount option is deprecated and has no effect\n");
+		break;
+	case Opt_codepage:
+		pr_warn("exFAT-fs: 'codepage' mount option is deprecated and has no effect\n");
+		break;
 	default:
 		return -EINVAL;
 	}
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] exfat: add the dummy mount options to be backward compatible with staging/exfat
  2020-05-21 14:05 [PATCH v2] exfat: add the dummy mount options to be backward compatible with staging/exfat Namjae Jeon
@ 2020-05-21 15:44 ` Eric Sandeen
  2020-05-21 17:57   ` Matthew Wilcox
  2020-05-21 18:15   ` Linus Torvalds
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Sandeen @ 2020-05-21 15:44 UTC (permalink / raw)
  To: Namjae Jeon, linux-fsdevel; +Cc: linux-kernel, torvalds

On 5/21/20 9:05 AM, Namjae Jeon wrote:
> 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 Torvalds reported 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.

Wow, it seems wild that we'd need to maintain compatibility with options
which only ever existed in a different codebase in a staging driver
(what's the point of staging if every interface that makes it that far has
to be maintained in perpetuity?)

Often, when things are deprecated, they are eventually removed.  Perhaps a
future removal date stated in this commit, or in Documentation/..../exfat.txt
would be good as a reminder to eventually remove this?

-Eric

> Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
> Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
> v2:
>  - fix checkpatch.pl warning(Missing Signed-off-by).
> 
>  fs/exfat/super.c | 22 ++++++++++++++++++++++
>  1 file changed, 22 insertions(+)
> 
> diff --git a/fs/exfat/super.c b/fs/exfat/super.c
> index 0565d5539d57..26b0db5b20de 100644
> --- a/fs/exfat/super.c
> +++ b/fs/exfat/super.c
> @@ -203,6 +203,12 @@ enum {
>  	Opt_errors,
>  	Opt_discard,
>  	Opt_time_offset,
> +
> +	/* Deprecated options */
> +	Opt_utf8,
> +	Opt_debug,
> +	Opt_namecase,
> +	Opt_codepage,
>  };
>  
>  static const struct constant_table exfat_param_enums[] = {
> @@ -223,6 +229,10 @@ static const struct fs_parameter_spec exfat_parameters[] = {
>  	fsparam_enum("errors",			Opt_errors, exfat_param_enums),
>  	fsparam_flag("discard",			Opt_discard),
>  	fsparam_s32("time_offset",		Opt_time_offset),
> +	fsparam_flag("utf8",			Opt_utf8),
> +	fsparam_flag("debug",			Opt_debug),
> +	fsparam_u32("namecase",			Opt_namecase),
> +	fsparam_u32("codepage",			Opt_codepage),
>  	{}
>  };
>  
> @@ -278,6 +288,18 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param)
>  			return -EINVAL;
>  		opts->time_offset = result.int_32;
>  		break;
> +	case Opt_utf8:
> +		pr_warn("exFAT-fs: 'utf8' mount option is deprecated and has no effect\n");
> +		break;
> +	case Opt_debug:
> +		pr_warn("exFAT-fs: 'debug' mount option is deprecated and has no effect\n");
> +		break;
> +	case Opt_namecase:
> +		pr_warn("exFAT-fs: 'namecase' mount option is deprecated and has no effect\n");
> +		break;
> +	case Opt_codepage:
> +		pr_warn("exFAT-fs: 'codepage' mount option is deprecated and has no effect\n");
> +		break;
>  	default:
>  		return -EINVAL;
>  	}
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] exfat: add the dummy mount options to be backward compatible with staging/exfat
  2020-05-21 15:44 ` Eric Sandeen
@ 2020-05-21 17:57   ` Matthew Wilcox
  2020-05-21 18:15   ` Linus Torvalds
  1 sibling, 0 replies; 4+ messages in thread
From: Matthew Wilcox @ 2020-05-21 17:57 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Namjae Jeon, linux-fsdevel, linux-kernel, torvalds

On Thu, May 21, 2020 at 10:44:28AM -0500, Eric Sandeen wrote:
> On 5/21/20 9:05 AM, Namjae Jeon wrote:
> > 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 Torvalds reported 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.
> 
> Wow, it seems wild that we'd need to maintain compatibility with options
> which only ever existed in a different codebase in a staging driver
> (what's the point of staging if every interface that makes it that far has
> to be maintained in perpetuity?)
> 
> Often, when things are deprecated, they are eventually removed.  Perhaps a
> future removal date stated in this commit, or in Documentation/..../exfat.txt
> would be good as a reminder to eventually remove this?

For NFS, 'intr' has been deprecated since December 2007 and has been
printing a warning since June 2008.  How long until we delete it?

> >  static const struct constant_table exfat_param_enums[] = {
> > @@ -223,6 +229,10 @@ static const struct fs_parameter_spec exfat_parameters[] = {
> >  	fsparam_enum("errors",			Opt_errors, exfat_param_enums),
> >  	fsparam_flag("discard",			Opt_discard),
> >  	fsparam_s32("time_offset",		Opt_time_offset),
> > +	fsparam_flag("utf8",			Opt_utf8),
> > +	fsparam_flag("debug",			Opt_debug),
> > +	fsparam_u32("namecase",			Opt_namecase),
> > +	fsparam_u32("codepage",			Opt_codepage),

	__fsparam(NULL, "utf8",		Opt_utf8, fs_param_deprecated, NULL),
	__fsparam(NULL, "debug",	Opt_debug, fs_param_deprecated, NULL),
	__fsparam(fs_param_is_u32, "namecase", Opt_namecase,
						fs_param_deprecated, NULL),
	__fsparam(fs_param_is_u32, "codepage", Opt_codepage,
						fs_param_deprecated, NULL),

> > @@ -278,6 +288,18 @@ static int exfat_parse_param(struct fs_context *fc, struct fs_parameter *param)
> >  			return -EINVAL;
> >  		opts->time_offset = result.int_32;
> >  		break;
> > +	case Opt_utf8:
> > +		pr_warn("exFAT-fs: 'utf8' mount option is deprecated and has no effect\n");
> > +		break;
> > +	case Opt_debug:
> > +		pr_warn("exFAT-fs: 'debug' mount option is deprecated and has no effect\n");
> > +		break;
> > +	case Opt_namecase:
> > +		pr_warn("exFAT-fs: 'namecase' mount option is deprecated and has no effect\n");
> > +		break;
> > +	case Opt_codepage:
> > +		pr_warn("exFAT-fs: 'codepage' mount option is deprecated and has no effect\n");
> > +		break;

and then you don't need this hunk because the fs parser will print the
deprecated message for you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] exfat: add the dummy mount options to be backward compatible with staging/exfat
  2020-05-21 15:44 ` Eric Sandeen
  2020-05-21 17:57   ` Matthew Wilcox
@ 2020-05-21 18:15   ` Linus Torvalds
  1 sibling, 0 replies; 4+ messages in thread
From: Linus Torvalds @ 2020-05-21 18:15 UTC (permalink / raw)
  To: Eric Sandeen; +Cc: Namjae Jeon, linux-fsdevel, Linux Kernel Mailing List

On Thu, May 21, 2020 at 8:44 AM Eric Sandeen <sandeen@sandeen.net> wrote:
>
> Wow, it seems wild that we'd need to maintain compatibility with options
> which only ever existed in a different codebase in a staging driver
> (what's the point of staging if every interface that makes it that far has
> to be maintained in perpetuity?)

The rules about regressions have never been about any kind of
documented behavior, or where the code lives.

The rules about regressions are always about "breaks user workflow".

Users are literally the _only_ thing that matters.

No amount of "you shouldn't have used this" or "that behavior was
undefined, it's your own fault your app broke" or "that used to work
simply because of a kernel bug" is at all relevant.

Now, reality is never entirely black-and-white. So we've had things
like "serious security issue" etc that just forces us to make changes
that may break user space. But even then the rule is that we don't
really have other options that would allow things to continue.

And obviously, if users take years to even notice that something
broke, or if we have sane ways to work around the breakage that
doesn't make for too much trouble for users (ie "ok, there are a
handful of users, and they can use a kernel command line to work
around it" kind of things) we've also been a bit less strict.

But no, "that was documented to be broken" (whether it's because the
code was in staging or because the man-page said something else) is
irrelevant. If staging code is so useful that people end up using it,
that means that it's basically regular kernel code with a flag saying
"please clean this up".

The other side of the coin is that people who talk about "API
stability" are entirely wrong. API's don't matter either. You can make
any changes to an API you like - as long as nobody notices.

Again, the regression rule is not about documentation, not about
API's, and not about the phase of the moon.

It's entirely about "we caused problems for user space that used to work".

                   Linus

PS. Obviously "API stability" is important in the sense that if you
_don't_ change any user-visible API's, that's a much safer change that
needs much less care than a change that _does_ change a user-visible
API.

So "API stability" isn't a meaningless concept, but it's not the"First
rule of kernel programming" that "no regressions" is. It's just that
there tends to be a correlation between "I made subtle API changes"
and "uhhuh, I broke user space".

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-05-21 18:15 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-21 14:05 [PATCH v2] exfat: add the dummy mount options to be backward compatible with staging/exfat Namjae Jeon
2020-05-21 15:44 ` Eric Sandeen
2020-05-21 17:57   ` Matthew Wilcox
2020-05-21 18:15   ` Linus Torvalds

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).