ntfs: compare streams_interface with mounted volume on remount
PATCH 1/1 ntfs: compare streams_interface with mounted volume on remount
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.
--- fs/ntfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/ntfs/super.c +2 -2
@@ -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 ; }
Signature · 1 line
2.43.0
Quoted 22 lines · DaeMyung Kang
During reconfiguration,
fc->s_fs_infopoints to a newly allocatedntfs_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 <[email protected]>--- fs/ntfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/ntfs/super.c +0
-0
fs/ntfs/super.c static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 282
Quoted 10 lines
fs/ntfs/super.c +2
-2@@ -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, sontfs_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.
Hi liubaolin.
Thanks for your reviews.
I will fix it soon.
2026년 10월 12일 (월) 오후 5:26, liubaolin <[email protected]>님이 작성:
Quoted 54 lines · DaeMyung Kang
Quoted 22 lines
During reconfiguration,
fc->s_fs_infopoints to a newly allocatedntfs_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 <[email protected]>--- fs/ntfs/super.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)fs/ntfs/super.c +0
-0fs/ntfs/super.c static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 282
Quoted 10 lines
fs/ntfs/super.c +2
-2@@ -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->sbis NULL in the newly allocated volume, sontfs_error()only logs the message. Changing the argument tofc->root->d_sbalso 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 triggeringthat policy?
Thanks,
Baolin.
PATCH v2 1/1 ntfs: compare streams_interface with mounted volume on remount
In reply to DaeMyung KangDuring 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.
---
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/[email protected]
fs/ntfs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/ntfs/super.c +3 -3
@@ -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)
Signature · 1 line
2.43.0
Quoted 33 lines · DaeMyung Kang
During reconfiguration,
fc->s_fs_infopoints to a newly allocatedntfs_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 <[email protected]>---
Changes in v2:
- Usentfs_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/[email protected]
fs/ntfs/super.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)fs/ntfs/super.c +0
-0@@ -275,9 +275,9 @@ static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param) result.uint_32 ==STREAMS_INTERFACE_WINDOWS ;
fs/ntfs/super.c static int ntfs_parse_param(struct fs_context *fc, struct fs_parameter *param) · line 283
Quoted 10 lines
fs/ntfs/super.c +3
-3if (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)
Looks good to me.
Quoted 9 lines · DaeMyung Kang
During reconfiguration,
fc->s_fs_infopoints to a newly allocatedntfs_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.
Quoted 6 lines
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 <[email protected]>
Applied it to #ntfs-next.
Thanks!