[PATCH v2 11/11] ntfsplus: add Kconfig and Makefile

Namjae Jeon posted 11 patches 4 days, 17 hours ago
[PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Namjae Jeon 4 days, 17 hours ago
This adds the Kconfig and Makefile for ntfsplus.

Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
---
 fs/Kconfig           |  1 +
 fs/Makefile          |  1 +
 fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
 fs/ntfsplus/Makefile | 18 ++++++++++++++++++
 4 files changed, 65 insertions(+)
 create mode 100644 fs/ntfsplus/Kconfig
 create mode 100644 fs/ntfsplus/Makefile

diff --git a/fs/Kconfig b/fs/Kconfig
index 0bfdaecaa877..70d596b99c8b 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
 source "fs/fat/Kconfig"
 source "fs/exfat/Kconfig"
 source "fs/ntfs3/Kconfig"
+source "fs/ntfsplus/Kconfig"
 
 endmenu
 endif # BLOCK
diff --git a/fs/Makefile b/fs/Makefile
index e3523ab2e587..2e2473451508 100644
--- a/fs/Makefile
+++ b/fs/Makefile
@@ -91,6 +91,7 @@ obj-y				+= unicode/
 obj-$(CONFIG_SMBFS)		+= smb/
 obj-$(CONFIG_HPFS_FS)		+= hpfs/
 obj-$(CONFIG_NTFS3_FS)		+= ntfs3/
+obj-$(CONFIG_NTFSPLUS_FS)	+= ntfsplus/
 obj-$(CONFIG_UFS_FS)		+= ufs/
 obj-$(CONFIG_EFS_FS)		+= efs/
 obj-$(CONFIG_JFFS2_FS)		+= jffs2/
diff --git a/fs/ntfsplus/Kconfig b/fs/ntfsplus/Kconfig
new file mode 100644
index 000000000000..c13cd06720e7
--- /dev/null
+++ b/fs/ntfsplus/Kconfig
@@ -0,0 +1,45 @@
+# SPDX-License-Identifier: GPL-2.0-only
+config NTFSPLUS_FS
+	tristate "NTFS+ file system support"
+	select NLS
+	help
+	  NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
+	  This allows you to mount devices formatted with the ntfs file system.
+
+	  To compile this as a module, choose M here: the module will be called
+	  ntfsplus.
+
+config NTFSPLUS_DEBUG
+	bool "NTFS+ debugging support"
+	depends on NTFSPLUS_FS
+	help
+	  If you are experiencing any problems with the NTFS file system, say
+	  Y here.  This will result in additional consistency checks to be
+	  performed by the driver as well as additional debugging messages to
+	  be written to the system log.  Note that debugging messages are
+	  disabled by default.  To enable them, supply the option debug_msgs=1
+	  at the kernel command line when booting the kernel or as an option
+	  to insmod when loading the ntfs module.  Once the driver is active,
+	  you can enable debugging messages by doing (as root):
+	  echo 1 > /proc/sys/fs/ntfs-debug
+	  Replacing the "1" with "0" would disable debug messages.
+
+	  If you leave debugging messages disabled, this results in little
+	  overhead, but enabling debug messages results in very significant
+	  slowdown of the system.
+
+	  When reporting bugs, please try to have available a full dump of
+	  debugging messages while the misbehaviour was occurring.
+
+config NTFSPLUS_FS_POSIX_ACL
+	bool "NTFS+ POSIX Access Control Lists"
+	depends on NTFSPLUS_FS
+	select FS_POSIX_ACL
+	help
+	  POSIX Access Control Lists (ACLs) support additional access rights
+	  for users and groups beyond the standard owner/group/world scheme,
+	  and this option selects support for ACLs specifically for ntfs
+	  filesystems.
+	  NOTE: this is linux only feature. Windows will ignore these ACLs.
+
+	  If you don't know what Access Control Lists are, say N.
diff --git a/fs/ntfsplus/Makefile b/fs/ntfsplus/Makefile
new file mode 100644
index 000000000000..1e7e830dbeec
--- /dev/null
+++ b/fs/ntfsplus/Makefile
@@ -0,0 +1,18 @@
+# SPDX-License-Identifier: GPL-2.0
+#
+# Makefile for the ntfsplus filesystem support.
+#
+
+# to check robot warnings
+ccflags-y += -Wint-to-pointer-cast \
+        $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \
+        $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration)
+
+obj-$(CONFIG_NTFSPLUS_FS) += ntfsplus.o
+
+ntfsplus-y := aops.o attrib.o collate.o misc.o dir.o file.o index.o inode.o \
+	  mft.o mst.o namei.o runlist.o super.o unistr.o attrlist.o ea.o \
+	  upcase.o bitmap.o lcnalloc.o logfile.o reparse.o compress.o \
+	  ntfs_iomap.o
+
+ccflags-$(CONFIG_NTFSPLUS_DEBUG) += -DDEBUG
-- 
2.25.1
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Amir Goldstein 4 days, 10 hours ago
On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
>
> This adds the Kconfig and Makefile for ntfsplus.
>
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
>  fs/Kconfig           |  1 +
>  fs/Makefile          |  1 +
>  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
>  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
>  4 files changed, 65 insertions(+)
>  create mode 100644 fs/ntfsplus/Kconfig
>  create mode 100644 fs/ntfsplus/Makefile
>
> diff --git a/fs/Kconfig b/fs/Kconfig
> index 0bfdaecaa877..70d596b99c8b 100644
> --- a/fs/Kconfig
> +++ b/fs/Kconfig
> @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
>  source "fs/fat/Kconfig"
>  source "fs/exfat/Kconfig"
>  source "fs/ntfs3/Kconfig"
> +source "fs/ntfsplus/Kconfig"
>
>  endmenu
>  endif # BLOCK
> diff --git a/fs/Makefile b/fs/Makefile
> index e3523ab2e587..2e2473451508 100644
> --- a/fs/Makefile
> +++ b/fs/Makefile
> @@ -91,6 +91,7 @@ obj-y                         += unicode/
>  obj-$(CONFIG_SMBFS)            += smb/
>  obj-$(CONFIG_HPFS_FS)          += hpfs/
>  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/

I suggested in another reply to keep the original ntfs name

More important is to keep your driver linked before the unmaintained
ntfs3, so that it hopefully gets picked up before ntfs3 for auto mount type
if both drivers are built-in.

I am not sure if keeping the order here would guarantee the link/registration
order. If not, it may make sense to mutually exclude them as built-in drivers.

Thanks,
Amir.
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Namjae Jeon 4 days, 9 hours ago
On Thu, Nov 27, 2025 at 8:22 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
> >
> > This adds the Kconfig and Makefile for ntfsplus.
> >
> > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > ---
> >  fs/Kconfig           |  1 +
> >  fs/Makefile          |  1 +
> >  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
> >  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
> >  4 files changed, 65 insertions(+)
> >  create mode 100644 fs/ntfsplus/Kconfig
> >  create mode 100644 fs/ntfsplus/Makefile
> >
> > diff --git a/fs/Kconfig b/fs/Kconfig
> > index 0bfdaecaa877..70d596b99c8b 100644
> > --- a/fs/Kconfig
> > +++ b/fs/Kconfig
> > @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
> >  source "fs/fat/Kconfig"
> >  source "fs/exfat/Kconfig"
> >  source "fs/ntfs3/Kconfig"
> > +source "fs/ntfsplus/Kconfig"
> >
> >  endmenu
> >  endif # BLOCK
> > diff --git a/fs/Makefile b/fs/Makefile
> > index e3523ab2e587..2e2473451508 100644
> > --- a/fs/Makefile
> > +++ b/fs/Makefile
> > @@ -91,6 +91,7 @@ obj-y                         += unicode/
> >  obj-$(CONFIG_SMBFS)            += smb/
> >  obj-$(CONFIG_HPFS_FS)          += hpfs/
> >  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> > +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/
>
> I suggested in another reply to keep the original ntfs name
>
> More important is to keep your driver linked before the unmaintained
> ntfs3, so that it hopefully gets picked up before ntfs3 for auto mount type
> if both drivers are built-in.
Okay, I will check it:)
>
> I am not sure if keeping the order here would guarantee the link/registration
> order. If not, it may make sense to mutually exclude them as built-in drivers.
Okay, I am leaning towards the latter. If you have no objection, I
will add the patch to mutually excluding the two ntfs implementation.
Thanks!
>
> Thanks,
> Amir.
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Amir Goldstein 4 days, 8 hours ago
On Thu, Nov 27, 2025 at 1:40 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
>
> On Thu, Nov 27, 2025 at 8:22 PM Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
> > >
> > > This adds the Kconfig and Makefile for ntfsplus.
> > >
> > > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > > ---
> > >  fs/Kconfig           |  1 +
> > >  fs/Makefile          |  1 +
> > >  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
> > >  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
> > >  4 files changed, 65 insertions(+)
> > >  create mode 100644 fs/ntfsplus/Kconfig
> > >  create mode 100644 fs/ntfsplus/Makefile
> > >
> > > diff --git a/fs/Kconfig b/fs/Kconfig
> > > index 0bfdaecaa877..70d596b99c8b 100644
> > > --- a/fs/Kconfig
> > > +++ b/fs/Kconfig
> > > @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
> > >  source "fs/fat/Kconfig"
> > >  source "fs/exfat/Kconfig"
> > >  source "fs/ntfs3/Kconfig"
> > > +source "fs/ntfsplus/Kconfig"
> > >
> > >  endmenu
> > >  endif # BLOCK
> > > diff --git a/fs/Makefile b/fs/Makefile
> > > index e3523ab2e587..2e2473451508 100644
> > > --- a/fs/Makefile
> > > +++ b/fs/Makefile
> > > @@ -91,6 +91,7 @@ obj-y                         += unicode/
> > >  obj-$(CONFIG_SMBFS)            += smb/
> > >  obj-$(CONFIG_HPFS_FS)          += hpfs/
> > >  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> > > +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/
> >
> > I suggested in another reply to keep the original ntfs name
> >
> > More important is to keep your driver linked before the unmaintained
> > ntfs3, so that it hopefully gets picked up before ntfs3 for auto mount type
> > if both drivers are built-in.
> Okay, I will check it:)
> >
> > I am not sure if keeping the order here would guarantee the link/registration
> > order. If not, it may make sense to mutually exclude them as built-in drivers.
> Okay, I am leaning towards the latter.

Well it's not this OR that.
please add you driver as the original was before ntfs3

obj-$(CONFIG_NTFS_FS)      += ntfs/
obj-$(CONFIG_NTFS3_FS)         += ntfs3/

> If you have no objection, I will add the patch to mutually exclude the two ntfs implementation.

You should definitely allow them both if at least one is built as a module
I think it would be valuable for testing.

Just that
CONFIG_NTFS_FS=y
CONFIG_NTFS3_FS=y

I don't see the usefulness in allowing that.
(other people may disagree)

I think that the way to implement it is using an auxiliary choice config var
in fs/Kconfig (i.e. CONFIG_DEFAULT_NTFS) and select/depends statements
to only allow the default ntfs driver to be configured as 'y',
but couldn't find a good example to point you at.

Thanks,
Amir.
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Namjae Jeon 3 days, 19 hours ago
On Thu, Nov 27, 2025 at 10:12 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Thu, Nov 27, 2025 at 1:40 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
> >
> > On Thu, Nov 27, 2025 at 8:22 PM Amir Goldstein <amir73il@gmail.com> wrote:
> > >
> > > On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
> > > >
> > > > This adds the Kconfig and Makefile for ntfsplus.
> > > >
> > > > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > > > ---
> > > >  fs/Kconfig           |  1 +
> > > >  fs/Makefile          |  1 +
> > > >  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
> > > >  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
> > > >  4 files changed, 65 insertions(+)
> > > >  create mode 100644 fs/ntfsplus/Kconfig
> > > >  create mode 100644 fs/ntfsplus/Makefile
> > > >
> > > > diff --git a/fs/Kconfig b/fs/Kconfig
> > > > index 0bfdaecaa877..70d596b99c8b 100644
> > > > --- a/fs/Kconfig
> > > > +++ b/fs/Kconfig
> > > > @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
> > > >  source "fs/fat/Kconfig"
> > > >  source "fs/exfat/Kconfig"
> > > >  source "fs/ntfs3/Kconfig"
> > > > +source "fs/ntfsplus/Kconfig"
> > > >
> > > >  endmenu
> > > >  endif # BLOCK
> > > > diff --git a/fs/Makefile b/fs/Makefile
> > > > index e3523ab2e587..2e2473451508 100644
> > > > --- a/fs/Makefile
> > > > +++ b/fs/Makefile
> > > > @@ -91,6 +91,7 @@ obj-y                         += unicode/
> > > >  obj-$(CONFIG_SMBFS)            += smb/
> > > >  obj-$(CONFIG_HPFS_FS)          += hpfs/
> > > >  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> > > > +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/
> > >
> > > I suggested in another reply to keep the original ntfs name
> > >
> > > More important is to keep your driver linked before the unmaintained
> > > ntfs3, so that it hopefully gets picked up before ntfs3 for auto mount type
> > > if both drivers are built-in.
> > Okay, I will check it:)
> > >
> > > I am not sure if keeping the order here would guarantee the link/registration
> > > order. If not, it may make sense to mutually exclude them as built-in drivers.
> > Okay, I am leaning towards the latter.
>
> Well it's not this OR that.
> please add you driver as the original was before ntfs3
>
> obj-$(CONFIG_NTFS_FS)      += ntfs/
> obj-$(CONFIG_NTFS3_FS)         += ntfs3/
Okay.
>
> > If you have no objection, I will add the patch to mutually exclude the two ntfs implementation.
>
> You should definitely allow them both if at least one is built as a module
> I think it would be valuable for testing.
>
> Just that
> CONFIG_NTFS_FS=y
> CONFIG_NTFS3_FS=y
>
> I don't see the usefulness in allowing that.
> (other people may disagree)
>
> I think that the way to implement it is using an auxiliary choice config var
> in fs/Kconfig (i.e. CONFIG_DEFAULT_NTFS) and select/depends statements
> to only allow the default ntfs driver to be configured as 'y',
> but couldn't find a good example to point you at.
Okay. Could you please check whether the attached patch matches what
you described ?

Thanks!
>
> Thanks,
> Amir.
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Amir Goldstein 3 days, 11 hours ago
On Fri, Nov 28, 2025 at 12:02:25PM +0900, Namjae Jeon wrote:
> On Thu, Nov 27, 2025 at 10:12 PM Amir Goldstein <amir73il@gmail.com> wrote:
> >
> > On Thu, Nov 27, 2025 at 1:40 PM Namjae Jeon <linkinjeon@kernel.org> wrote:
> > >
> > > On Thu, Nov 27, 2025 at 8:22 PM Amir Goldstein <amir73il@gmail.com> wrote:
> > > >
> > > > On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
> > > > >
> > > > > This adds the Kconfig and Makefile for ntfsplus.
> > > > >
> > > > > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > > > > ---
> > > > >  fs/Kconfig           |  1 +
> > > > >  fs/Makefile          |  1 +
> > > > >  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
> > > > >  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
> > > > >  4 files changed, 65 insertions(+)
> > > > >  create mode 100644 fs/ntfsplus/Kconfig
> > > > >  create mode 100644 fs/ntfsplus/Makefile
> > > > >
> > > > > diff --git a/fs/Kconfig b/fs/Kconfig
> > > > > index 0bfdaecaa877..70d596b99c8b 100644
> > > > > --- a/fs/Kconfig
> > > > > +++ b/fs/Kconfig
> > > > > @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
> > > > >  source "fs/fat/Kconfig"
> > > > >  source "fs/exfat/Kconfig"
> > > > >  source "fs/ntfs3/Kconfig"
> > > > > +source "fs/ntfsplus/Kconfig"
> > > > >
> > > > >  endmenu
> > > > >  endif # BLOCK
> > > > > diff --git a/fs/Makefile b/fs/Makefile
> > > > > index e3523ab2e587..2e2473451508 100644
> > > > > --- a/fs/Makefile
> > > > > +++ b/fs/Makefile
> > > > > @@ -91,6 +91,7 @@ obj-y                         += unicode/
> > > > >  obj-$(CONFIG_SMBFS)            += smb/
> > > > >  obj-$(CONFIG_HPFS_FS)          += hpfs/
> > > > >  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> > > > > +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/
> > > >
> > > > I suggested in another reply to keep the original ntfs name
> > > >
> > > > More important is to keep your driver linked before the unmaintained
> > > > ntfs3, so that it hopefully gets picked up before ntfs3 for auto mount type
> > > > if both drivers are built-in.
> > > Okay, I will check it:)
> > > >
> > > > I am not sure if keeping the order here would guarantee the link/registration
> > > > order. If not, it may make sense to mutually exclude them as built-in drivers.
> > > Okay, I am leaning towards the latter.
> >
> > Well it's not this OR that.
> > please add you driver as the original was before ntfs3
> >
> > obj-$(CONFIG_NTFS_FS)      += ntfs/
> > obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> Okay.
> >
> > > If you have no objection, I will add the patch to mutually exclude the two ntfs implementation.
> >
> > You should definitely allow them both if at least one is built as a module
> > I think it would be valuable for testing.
> >
> > Just that
> > CONFIG_NTFS_FS=y
> > CONFIG_NTFS3_FS=y
> >
> > I don't see the usefulness in allowing that.
> > (other people may disagree)
> >
> > I think that the way to implement it is using an auxiliary choice config var
> > in fs/Kconfig (i.e. CONFIG_DEFAULT_NTFS) and select/depends statements
> > to only allow the default ntfs driver to be configured as 'y',
> > but couldn't find a good example to point you at.
> Okay. Could you please check whether the attached patch matches what
> you described ?

It's what I meant, but now I think it could be simpler...

> 
> Thanks!
> >
> > Thanks,
> > Amir.

> From 11154917ff53d6cf218ac58e6776e603246587b6 Mon Sep 17 00:00:00 2001
> From: Namjae Jeon <linkinjeon@kernel.org>
> Date: Fri, 28 Nov 2025 11:44:45 +0900
> Subject: [PATCH] ntfs: restrict built-in NTFS seclection to one driver, allow
>  both as modules
> 
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
>  fs/Kconfig          | 11 +++++++++++
>  fs/ntfs3/Kconfig    |  2 ++
>  fs/ntfsplus/Kconfig |  1 +
>  3 files changed, 14 insertions(+)
> 
> diff --git a/fs/Kconfig b/fs/Kconfig
> index 70d596b99c8b..c379383cb4ff 100644
> --- a/fs/Kconfig
> +++ b/fs/Kconfig
> @@ -155,6 +155,17 @@ source "fs/exfat/Kconfig"
>  source "fs/ntfs3/Kconfig"
>  source "fs/ntfsplus/Kconfig"
>  
> +choice
> +   prompt "Select built-in NTFS filesystem (only one can be built-in)"
Usually for choice vars there should be a default and usually
there should be a DEFAULT_NTFS_NONE

> +   help
> +     Only one NTFS can be built into the kernel(y).
> +     Both can still be built as modules(m).
> +
> +   config DEFAULT_NTFSPLUS
> +       bool "NTFS+"
Usually, this would also 'select NTFS_FS'

> +   config DEFAULT_NTFS3
> +       bool "NTFS3"
> +endchoice
>  endmenu
>  endif # BLOCK
>  
> diff --git a/fs/ntfs3/Kconfig b/fs/ntfs3/Kconfig
> index 7bc31d69f680..18bd6c98c6eb 100644
> --- a/fs/ntfs3/Kconfig
> +++ b/fs/ntfs3/Kconfig
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config NTFS3_FS
>  	tristate "NTFS Read-Write file system support"
> +	depends on !DEFAULT_NTFSPLUS || m

So seeing how this condition looks, instead of aux var,
it could be directly

	depends on NTFS_FS != y || m

>  	select BUFFER_HEAD
>  	select NLS
>  	select LEGACY_DIRECT_IO
> @@ -49,6 +50,7 @@ config NTFS3_FS_POSIX_ACL
>  
>  config NTFS_FS

This alias should definitely go a way when you add back
the original NTFS_FS.

Preferably revert the commit that added the alias at the
start of your series.

>  	tristate "NTFS file system support"
> +	depends on !DEFAULT_NTFSPLUS || m
>  	select NTFS3_FS
>  	select BUFFER_HEAD
>  	select NLS
> diff --git a/fs/ntfsplus/Kconfig b/fs/ntfsplus/Kconfig
> index 78bc34840463..c8d1ab99113c 100644
> --- a/fs/ntfsplus/Kconfig
> +++ b/fs/ntfsplus/Kconfig
> @@ -1,6 +1,7 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  config NTFSPLUS_FS
>  	tristate "NTFS+ file system support (EXPERIMENTAL)"
> +	depends on !DEFAULT_NTFS3 || m

Likewise:
	depends on NTFS3_FS != y || m

Obviously, not tested.

If this works, I don't think there is a need for the choice variable

As long as you keep the order in fs/Kconfig correct (ntfs before ntfs3)
I assume that an oldconfig with both set to y NTFS_FS will win?
Please verify that.

Thanks,
Amir.
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Namjae Jeon 3 days, 9 hours ago
> > > I think that the way to implement it is using an auxiliary choice config var
> > > in fs/Kconfig (i.e. CONFIG_DEFAULT_NTFS) and select/depends statements
> > > to only allow the default ntfs driver to be configured as 'y',
> > > but couldn't find a good example to point you at.
> > Okay. Could you please check whether the attached patch matches what
> > you described ?
>
> It's what I meant, but now I think it could be simpler...
>
> >
> > Thanks!
> > >
> > > Thanks,
> > > Amir.
>
> > From 11154917ff53d6cf218ac58e6776e603246587b6 Mon Sep 17 00:00:00 2001
> > From: Namjae Jeon <linkinjeon@kernel.org>
> > Date: Fri, 28 Nov 2025 11:44:45 +0900
> > Subject: [PATCH] ntfs: restrict built-in NTFS seclection to one driver, allow
> >  both as modules
> >
> > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > ---
> >  fs/Kconfig          | 11 +++++++++++
> >  fs/ntfs3/Kconfig    |  2 ++
> >  fs/ntfsplus/Kconfig |  1 +
> >  3 files changed, 14 insertions(+)
> >
> > diff --git a/fs/Kconfig b/fs/Kconfig
> > index 70d596b99c8b..c379383cb4ff 100644
> > --- a/fs/Kconfig
> > +++ b/fs/Kconfig
> > @@ -155,6 +155,17 @@ source "fs/exfat/Kconfig"
> >  source "fs/ntfs3/Kconfig"
> >  source "fs/ntfsplus/Kconfig"
> >
> > +choice
> > +   prompt "Select built-in NTFS filesystem (only one can be built-in)"
> Usually for choice vars there should be a default and usually
> there should be a DEFAULT_NTFS_NONE
Okay.
>
> > +   help
> > +     Only one NTFS can be built into the kernel(y).
> > +     Both can still be built as modules(m).
> > +
> > +   config DEFAULT_NTFSPLUS
> > +       bool "NTFS+"
> Usually, this would also 'select NTFS_FS'
Okay.
>
> > +   config DEFAULT_NTFS3
> > +       bool "NTFS3"
> > +endchoice
> >  endmenu
> >  endif # BLOCK
> >
> > diff --git a/fs/ntfs3/Kconfig b/fs/ntfs3/Kconfig
> > index 7bc31d69f680..18bd6c98c6eb 100644
> > --- a/fs/ntfs3/Kconfig
> > +++ b/fs/ntfs3/Kconfig
> > @@ -1,6 +1,7 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  config NTFS3_FS
> >       tristate "NTFS Read-Write file system support"
> > +     depends on !DEFAULT_NTFSPLUS || m
>
> So seeing how this condition looks, instead of aux var,
> it could be directly
>
>         depends on NTFS_FS != y || m
Okay.
>
> >       select BUFFER_HEAD
> >       select NLS
> >       select LEGACY_DIRECT_IO
> > @@ -49,6 +50,7 @@ config NTFS3_FS_POSIX_ACL
> >
> >  config NTFS_FS
>
> This alias should definitely go a way when you add back
> the original NTFS_FS.
>
> Preferably revert the commit that added the alias at the
> start of your series.
Okay.
>
> >       tristate "NTFS file system support"
> > +     depends on !DEFAULT_NTFSPLUS || m
> >       select NTFS3_FS
> >       select BUFFER_HEAD
> >       select NLS
> > diff --git a/fs/ntfsplus/Kconfig b/fs/ntfsplus/Kconfig
> > index 78bc34840463..c8d1ab99113c 100644
> > --- a/fs/ntfsplus/Kconfig
> > +++ b/fs/ntfsplus/Kconfig
> > @@ -1,6 +1,7 @@
> >  # SPDX-License-Identifier: GPL-2.0-only
> >  config NTFSPLUS_FS
> >       tristate "NTFS+ file system support (EXPERIMENTAL)"
> > +     depends on !DEFAULT_NTFS3 || m
>
> Likewise:
>         depends on NTFS3_FS != y || m
>
> Obviously, not tested.
>
> If this works, I don't think there is a need for the choice variable
>
> As long as you keep the order in fs/Kconfig correct (ntfs before ntfs3)
> I assume that an oldconfig with both set to y NTFS_FS will win?
> Please verify that.
Okay, I will check it.
Thanks for your review!
>
> Thanks,
> Amir.
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Amir Goldstein 4 days, 12 hours ago
On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
>
> This adds the Kconfig and Makefile for ntfsplus.

MAINTAINERS?

>
> Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> ---
>  fs/Kconfig           |  1 +
>  fs/Makefile          |  1 +
>  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
>  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
>  4 files changed, 65 insertions(+)
>  create mode 100644 fs/ntfsplus/Kconfig
>  create mode 100644 fs/ntfsplus/Makefile
>
> diff --git a/fs/Kconfig b/fs/Kconfig
> index 0bfdaecaa877..70d596b99c8b 100644
> --- a/fs/Kconfig
> +++ b/fs/Kconfig
> @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
>  source "fs/fat/Kconfig"
>  source "fs/exfat/Kconfig"
>  source "fs/ntfs3/Kconfig"
> +source "fs/ntfsplus/Kconfig"
>
>  endmenu
>  endif # BLOCK
> diff --git a/fs/Makefile b/fs/Makefile
> index e3523ab2e587..2e2473451508 100644
> --- a/fs/Makefile
> +++ b/fs/Makefile
> @@ -91,6 +91,7 @@ obj-y                         += unicode/
>  obj-$(CONFIG_SMBFS)            += smb/
>  obj-$(CONFIG_HPFS_FS)          += hpfs/
>  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/
>  obj-$(CONFIG_UFS_FS)           += ufs/
>  obj-$(CONFIG_EFS_FS)           += efs/
>  obj-$(CONFIG_JFFS2_FS)         += jffs2/
> diff --git a/fs/ntfsplus/Kconfig b/fs/ntfsplus/Kconfig
> new file mode 100644
> index 000000000000..c13cd06720e7
> --- /dev/null
> +++ b/fs/ntfsplus/Kconfig
> @@ -0,0 +1,45 @@
> +# SPDX-License-Identifier: GPL-2.0-only
> +config NTFSPLUS_FS
> +       tristate "NTFS+ file system support"
> +       select NLS
> +       help
> +         NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
> +         This allows you to mount devices formatted with the ntfs file system.
> +
> +         To compile this as a module, choose M here: the module will be called
> +         ntfsplus.
> +
> +config NTFSPLUS_DEBUG
> +       bool "NTFS+ debugging support"
> +       depends on NTFSPLUS_FS
> +       help
> +         If you are experiencing any problems with the NTFS file system, say
> +         Y here.  This will result in additional consistency checks to be
> +         performed by the driver as well as additional debugging messages to
> +         be written to the system log.  Note that debugging messages are
> +         disabled by default.  To enable them, supply the option debug_msgs=1
> +         at the kernel command line when booting the kernel or as an option
> +         to insmod when loading the ntfs module.  Once the driver is active,
> +         you can enable debugging messages by doing (as root):
> +         echo 1 > /proc/sys/fs/ntfs-debug
> +         Replacing the "1" with "0" would disable debug messages.
> +
> +         If you leave debugging messages disabled, this results in little
> +         overhead, but enabling debug messages results in very significant
> +         slowdown of the system.
> +
> +         When reporting bugs, please try to have available a full dump of
> +         debugging messages while the misbehaviour was occurring.
> +
> +config NTFSPLUS_FS_POSIX_ACL
> +       bool "NTFS+ POSIX Access Control Lists"
> +       depends on NTFSPLUS_FS
> +       select FS_POSIX_ACL
> +       help
> +         POSIX Access Control Lists (ACLs) support additional access rights
> +         for users and groups beyond the standard owner/group/world scheme,
> +         and this option selects support for ACLs specifically for ntfs
> +         filesystems.
> +         NOTE: this is linux only feature. Windows will ignore these ACLs.
> +
> +         If you don't know what Access Control Lists are, say N.
> diff --git a/fs/ntfsplus/Makefile b/fs/ntfsplus/Makefile
> new file mode 100644
> index 000000000000..1e7e830dbeec
> --- /dev/null
> +++ b/fs/ntfsplus/Makefile
> @@ -0,0 +1,18 @@
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Makefile for the ntfsplus filesystem support.
> +#
> +
> +# to check robot warnings
> +ccflags-y += -Wint-to-pointer-cast \
> +        $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \
> +        $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration)
> +
> +obj-$(CONFIG_NTFSPLUS_FS) += ntfsplus.o
> +
> +ntfsplus-y := aops.o attrib.o collate.o misc.o dir.o file.o index.o inode.o \
> +         mft.o mst.o namei.o runlist.o super.o unistr.o attrlist.o ea.o \
> +         upcase.o bitmap.o lcnalloc.o logfile.o reparse.o compress.o \
> +         ntfs_iomap.o
> +
> +ccflags-$(CONFIG_NTFSPLUS_DEBUG) += -DDEBUG
> --
> 2.25.1
>
Re: [PATCH v2 11/11] ntfsplus: add Kconfig and Makefile
Posted by Namjae Jeon 4 days, 9 hours ago
On Thu, Nov 27, 2025 at 6:31 PM Amir Goldstein <amir73il@gmail.com> wrote:
>
> On Thu, Nov 27, 2025 at 6:01 AM Namjae Jeon <linkinjeon@kernel.org> wrote:
> >
> > This adds the Kconfig and Makefile for ntfsplus.
>
> MAINTAINERS?
Okay, I will add it on next version:)
Thanks!
>
> >
> > Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
> > ---
> >  fs/Kconfig           |  1 +
> >  fs/Makefile          |  1 +
> >  fs/ntfsplus/Kconfig  | 45 ++++++++++++++++++++++++++++++++++++++++++++
> >  fs/ntfsplus/Makefile | 18 ++++++++++++++++++
> >  4 files changed, 65 insertions(+)
> >  create mode 100644 fs/ntfsplus/Kconfig
> >  create mode 100644 fs/ntfsplus/Makefile
> >
> > diff --git a/fs/Kconfig b/fs/Kconfig
> > index 0bfdaecaa877..70d596b99c8b 100644
> > --- a/fs/Kconfig
> > +++ b/fs/Kconfig
> > @@ -153,6 +153,7 @@ menu "DOS/FAT/EXFAT/NT Filesystems"
> >  source "fs/fat/Kconfig"
> >  source "fs/exfat/Kconfig"
> >  source "fs/ntfs3/Kconfig"
> > +source "fs/ntfsplus/Kconfig"
> >
> >  endmenu
> >  endif # BLOCK
> > diff --git a/fs/Makefile b/fs/Makefile
> > index e3523ab2e587..2e2473451508 100644
> > --- a/fs/Makefile
> > +++ b/fs/Makefile
> > @@ -91,6 +91,7 @@ obj-y                         += unicode/
> >  obj-$(CONFIG_SMBFS)            += smb/
> >  obj-$(CONFIG_HPFS_FS)          += hpfs/
> >  obj-$(CONFIG_NTFS3_FS)         += ntfs3/
> > +obj-$(CONFIG_NTFSPLUS_FS)      += ntfsplus/
> >  obj-$(CONFIG_UFS_FS)           += ufs/
> >  obj-$(CONFIG_EFS_FS)           += efs/
> >  obj-$(CONFIG_JFFS2_FS)         += jffs2/
> > diff --git a/fs/ntfsplus/Kconfig b/fs/ntfsplus/Kconfig
> > new file mode 100644
> > index 000000000000..c13cd06720e7
> > --- /dev/null
> > +++ b/fs/ntfsplus/Kconfig
> > @@ -0,0 +1,45 @@
> > +# SPDX-License-Identifier: GPL-2.0-only
> > +config NTFSPLUS_FS
> > +       tristate "NTFS+ file system support"
> > +       select NLS
> > +       help
> > +         NTFS is the file system of Microsoft Windows NT, 2000, XP and 2003.
> > +         This allows you to mount devices formatted with the ntfs file system.
> > +
> > +         To compile this as a module, choose M here: the module will be called
> > +         ntfsplus.
> > +
> > +config NTFSPLUS_DEBUG
> > +       bool "NTFS+ debugging support"
> > +       depends on NTFSPLUS_FS
> > +       help
> > +         If you are experiencing any problems with the NTFS file system, say
> > +         Y here.  This will result in additional consistency checks to be
> > +         performed by the driver as well as additional debugging messages to
> > +         be written to the system log.  Note that debugging messages are
> > +         disabled by default.  To enable them, supply the option debug_msgs=1
> > +         at the kernel command line when booting the kernel or as an option
> > +         to insmod when loading the ntfs module.  Once the driver is active,
> > +         you can enable debugging messages by doing (as root):
> > +         echo 1 > /proc/sys/fs/ntfs-debug
> > +         Replacing the "1" with "0" would disable debug messages.
> > +
> > +         If you leave debugging messages disabled, this results in little
> > +         overhead, but enabling debug messages results in very significant
> > +         slowdown of the system.
> > +
> > +         When reporting bugs, please try to have available a full dump of
> > +         debugging messages while the misbehaviour was occurring.
> > +
> > +config NTFSPLUS_FS_POSIX_ACL
> > +       bool "NTFS+ POSIX Access Control Lists"
> > +       depends on NTFSPLUS_FS
> > +       select FS_POSIX_ACL
> > +       help
> > +         POSIX Access Control Lists (ACLs) support additional access rights
> > +         for users and groups beyond the standard owner/group/world scheme,
> > +         and this option selects support for ACLs specifically for ntfs
> > +         filesystems.
> > +         NOTE: this is linux only feature. Windows will ignore these ACLs.
> > +
> > +         If you don't know what Access Control Lists are, say N.
> > diff --git a/fs/ntfsplus/Makefile b/fs/ntfsplus/Makefile
> > new file mode 100644
> > index 000000000000..1e7e830dbeec
> > --- /dev/null
> > +++ b/fs/ntfsplus/Makefile
> > @@ -0,0 +1,18 @@
> > +# SPDX-License-Identifier: GPL-2.0
> > +#
> > +# Makefile for the ntfsplus filesystem support.
> > +#
> > +
> > +# to check robot warnings
> > +ccflags-y += -Wint-to-pointer-cast \
> > +        $(call cc-option,-Wunused-but-set-variable,-Wunused-const-variable) \
> > +        $(call cc-option,-Wold-style-declaration,-Wout-of-line-declaration)
> > +
> > +obj-$(CONFIG_NTFSPLUS_FS) += ntfsplus.o
> > +
> > +ntfsplus-y := aops.o attrib.o collate.o misc.o dir.o file.o index.o inode.o \
> > +         mft.o mst.o namei.o runlist.o super.o unistr.o attrlist.o ea.o \
> > +         upcase.o bitmap.o lcnalloc.o logfile.o reparse.o compress.o \
> > +         ntfs_iomap.o
> > +
> > +ccflags-$(CONFIG_NTFSPLUS_DEBUG) += -DDEBUG
> > --
> > 2.25.1
> >