[PATCH 01/11] fs/ntfs3: show supported options when an unknown one is given

From: Konstantin Komarov

Date: Fri Oct 09 2026 - 13:23:20 EST


When an unrecognised mount option is passed, fs_parse() returns
-ENOPARAM. Print the list of supported options alongside the key, so the
correct spelling can be found directly.

Signed-off-by: Konstantin Komarov <almaz.alexandrovich@xxxxxxxxxxxxxxxxxxxx>
---
fs/ntfs3/super.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index d3093f72ea38..7fd83027007b 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -339,6 +339,17 @@ static int ntfs_fs_parse_param(struct fs_context *fc,
int opt;

opt = fs_parse(fc, ntfs_fs_parameters, param, &result);
+
+ if (opt == -ENOPARAM && strcmp(param->key, "source")) {
+ /* Show mini help. */
+ pr_err("ntfs3: unknown option \"%s\". Use uid,gid,umask,"
+ "dmask,fmask,sys_immutable,discard,force,sparse,"
+ "nohidden,hide_dot_files,windows_names,showmeta,acl,"
+ "iocharset,prealloc,nocase,delalloc,ads",
+ param->key);
+ return -ENOPARAM;
+ }
+
if (opt < 0)
return opt;

--
2.43.0