mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ntfs: compare streams_interface with mounted volume on remount
@ 2026-10-12  3:16 DaeMyung Kang
  2026-10-12  8:25 ` liubaolin
  2026-10-12 11:27 ` [PATCH v2] " DaeMyung Kang
  0 siblings, 2 replies; 4+ messages in thread
From: DaeMyung Kang @ 2026-10-12  3:16 UTC (permalink / raw)
  To: linkinjeon; +Cc: hyc.lee, ntfs, linux-kernel, DaeMyung Kang

During reconfiguration, fc->s_fs_info points to a newly allocated
ntfs_volume. It does not contain the mounted volume's stream setting.
Consequently, a windows mount rejects a remount with the same
streams_interface=windows setting, but accepts streams_interface=none
without changing the active pathname interface. This also breaks an
ordinary read-only remount when the existing windows setting is passed
again, for example from fstab.

Compare the requested setting with the mounted volume instead. Use its
superblock when reporting an unsupported setting change.

Fixes: 2de2cdd9cc08 ("ntfs: add pathname access for named streams")
Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
---
 fs/ntfs/super.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 242fb19ced2b..711e90be9382 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -275,8 +275,8 @@ static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
 			result.uint_32 == STREAMS_INTERFACE_WINDOWS;
 
 		if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
-		    NVolStreamsWindows(vol) != streams_windows) {
-			ntfs_error(vol->sb,
+		    NVolStreamsWindows(NTFS_SB(fc->root->d_sb)) != streams_windows) {
+			ntfs_error(fc->root->d_sb,
 				   "Cannot change streams_interface on remount.");
 			return -EINVAL;
 		}
-- 
2.43.0


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

* Re: [PATCH] ntfs: compare streams_interface with mounted volume on remount
  2026-10-12  3:16 [PATCH] ntfs: compare streams_interface with mounted volume on remount DaeMyung Kang
@ 2026-10-12  8:25 ` liubaolin
  2026-10-12  9:06   ` CharSyam
  2026-10-12 11:27 ` [PATCH v2] " DaeMyung Kang
  1 sibling, 1 reply; 4+ messages in thread
From: liubaolin @ 2026-10-12  8:25 UTC (permalink / raw)
  To: DaeMyung Kang, linkinjeon; +Cc: hyc.lee, ntfs, linux-kernel



在 2026/10/12 11:16, DaeMyung Kang 写道:
> During reconfiguration, fc->s_fs_info points to a newly allocated
> ntfs_volume. It does not contain the mounted volume's stream setting.
> Consequently, a windows mount rejects a remount with the same
> streams_interface=windows setting, but accepts streams_interface=none
> without changing the active pathname interface. This also breaks an
> ordinary read-only remount when the existing windows setting is passed
> again, for example from fstab.
> 
> Compare the requested setting with the mounted volume instead. Use its
> superblock when reporting an unsupported setting change.
> 
> Fixes: 2de2cdd9cc08 ("ntfs: add pathname access for named streams")
> Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
> ---
>   fs/ntfs/super.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
> index 242fb19ced2b..711e90be9382 100644
> --- a/fs/ntfs/super.c
> +++ b/fs/ntfs/super.c
> @@ -275,8 +275,8 @@ static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
>   			result.uint_32 == STREAMS_INTERFACE_WINDOWS;
>   
>   		if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
> -		    NVolStreamsWindows(vol) != streams_windows) {
> -			ntfs_error(vol->sb,
> +		    NVolStreamsWindows(NTFS_SB(fc->root->d_sb)) != streams_windows) {
> +			ntfs_error(fc->root->d_sb,
>   				   "Cannot change streams_interface on remount.");
>   			return -EINVAL;
>   		}

Hi DaeMyung,

    The fix looks correct.
    However, vol->sb is NULL in the newly allocated volume, so 
ntfs_error() only logs the message. Changing the argument to 
fc->root->d_sb also invokes the mounted volume’s error-handling policy, 
which would trigger a panic on a read-write mount with errors=panic.

    This branch only rejects an unsupported option change during 
remount; it does not indicate filesystem corruption or an I/O error.

    Could we use ntfs_warning(fc->root->d_sb, ...) without triggering 
that policy?

Thanks,
Baolin.


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

* Re: [PATCH] ntfs: compare streams_interface with mounted volume on remount
  2026-10-12  8:25 ` liubaolin
@ 2026-10-12  9:06   ` CharSyam
  0 siblings, 0 replies; 4+ messages in thread
From: CharSyam @ 2026-10-12  9:06 UTC (permalink / raw)
  To: liubaolin; +Cc: linkinjeon, hyc.lee, ntfs, linux-kernel

Hi liubaolin.

Thanks for your reviews.
I will fix it soon.

2026년 10월 12일 (월) 오후 5:26, liubaolin <liubaolin12138@163.com>님이 작성:
>
>
>
> 在 2026/10/12 11:16, DaeMyung Kang 写道:
> > During reconfiguration, fc->s_fs_info points to a newly allocated
> > ntfs_volume. It does not contain the mounted volume's stream setting.
> > Consequently, a windows mount rejects a remount with the same
> > streams_interface=windows setting, but accepts streams_interface=none
> > without changing the active pathname interface. This also breaks an
> > ordinary read-only remount when the existing windows setting is passed
> > again, for example from fstab.
> >
> > Compare the requested setting with the mounted volume instead. Use its
> > superblock when reporting an unsupported setting change.
> >
> > Fixes: 2de2cdd9cc08 ("ntfs: add pathname access for named streams")
> > Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
> > ---
> >   fs/ntfs/super.c | 4 ++--
> >   1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
> > index 242fb19ced2b..711e90be9382 100644
> > --- a/fs/ntfs/super.c
> > +++ b/fs/ntfs/super.c
> > @@ -275,8 +275,8 @@ static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
> >                       result.uint_32 == STREAMS_INTERFACE_WINDOWS;
> >
> >               if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
> > -                 NVolStreamsWindows(vol) != streams_windows) {
> > -                     ntfs_error(vol->sb,
> > +                 NVolStreamsWindows(NTFS_SB(fc->root->d_sb)) != streams_windows) {
> > +                     ntfs_error(fc->root->d_sb,
> >                                  "Cannot change streams_interface on remount.");
> >                       return -EINVAL;
> >               }
>
> Hi DaeMyung,
>
>     The fix looks correct.
>     However, vol->sb is NULL in the newly allocated volume, so
> ntfs_error() only logs the message. Changing the argument to
> fc->root->d_sb also invokes the mounted volume’s error-handling policy,
> which would trigger a panic on a read-write mount with errors=panic.
>
>     This branch only rejects an unsupported option change during
> remount; it does not indicate filesystem corruption or an I/O error.
>
>     Could we use ntfs_warning(fc->root->d_sb, ...) without triggering
> that policy?
>
> Thanks,
> Baolin.
>

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

* [PATCH v2] ntfs: compare streams_interface with mounted volume on remount
  2026-10-12  3:16 [PATCH] ntfs: compare streams_interface with mounted volume on remount DaeMyung Kang
  2026-10-12  8:25 ` liubaolin
@ 2026-10-12 11:27 ` DaeMyung Kang
  1 sibling, 0 replies; 4+ messages in thread
From: DaeMyung Kang @ 2026-10-12 11:27 UTC (permalink / raw)
  To: Namjae Jeon; +Cc: Hyunchul Lee, Baolin Liu, ntfs, linux-kernel, DaeMyung Kang

During reconfiguration, fc->s_fs_info points to a newly allocated
ntfs_volume. It does not contain the mounted volume's stream setting.
Consequently, a windows mount rejects a remount with the same
streams_interface=windows setting, but accepts streams_interface=none
without changing the active pathname interface. This also breaks an
ordinary read-only remount when the existing windows setting is passed
again, for example from fstab.

Compare the requested setting with the mounted volume instead. Report
an unsupported change with ntfs_warning() so it does not invoke the
mounted filesystem's error-handling policy.

Fixes: 2de2cdd9cc08 ("ntfs: add pathname access for named streams")
Signed-off-by: DaeMyung Kang <charsyam@gmail.com>
---
Changes in v2:
- Use ntfs_warning() so a rejected option change does not invoke the
  mounted volume's error policy, as Baolin suggested.
- Explain in the commit message why logging must not invoke the mounted
  filesystem's error policy.

Link to v1: https://lore.kernel.org/r/20261012031656.3858771-1-charsyam@gmail.com

 fs/ntfs/super.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/ntfs/super.c b/fs/ntfs/super.c
index 242fb19ced2b..ed9f29b16c7c 100644
--- a/fs/ntfs/super.c
+++ b/fs/ntfs/super.c
@@ -275,9 +275,9 @@ static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param)
 			result.uint_32 == STREAMS_INTERFACE_WINDOWS;
 
 		if (fc->purpose == FS_CONTEXT_FOR_RECONFIGURE &&
-		    NVolStreamsWindows(vol) != streams_windows) {
-			ntfs_error(vol->sb,
-				   "Cannot change streams_interface on remount.");
+		    NVolStreamsWindows(NTFS_SB(fc->root->d_sb)) != streams_windows) {
+			ntfs_warning(fc->root->d_sb,
+				     "Cannot change streams_interface on remount.");
 			return -EINVAL;
 		}
 		if (streams_windows)
-- 
2.43.0

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

end of thread, other threads:[~2026-10-12 11:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-12  3:16 [PATCH] ntfs: compare streams_interface with mounted volume on remount DaeMyung Kang
2026-10-12  8:25 ` liubaolin
2026-10-12  9:06   ` CharSyam
2026-10-12 11:27 ` [PATCH v2] " DaeMyung Kang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®