]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
cifs: client: enforce consistent handling of multichannel and max_channels
authorRajasi Mandal <rajasimandal@microsoft.com>
Tue, 18 Nov 2025 02:26:55 +0000 (02:26 +0000)
committerSteve French <stfrench@microsoft.com>
Thu, 4 Dec 2025 05:32:44 +0000 (23:32 -0600)
commit1ef15fbe6771119dc1d3bd4ed201100cfacb842e
tree3bd045af59431bad738f14c6022e66f2be3a08ca
parent869737543b39a145809c41a7253c6ee777e22729
cifs: client: enforce consistent handling of multichannel and max_channels

Previously, the behavior of the multichannel and max_channels mount
options was inconsistent and order-dependent. For example, specifying
"multichannel,max_channels=1" would result in 2 channels, while
"max_channels=1,multichannel" would result in 1 channel. Additionally,
conflicting combinations such as "nomultichannel,max_channels=3" or
"multichannel,max_channels=1" did not produce errors and could lead to
unexpected channel counts.

This commit introduces two new fields in smb3_fs_context to explicitly
track whether multichannel and max_channels were specified during
mount. The option parsing and validation logic is updated to ensure:
- The outcome is no longer dependent on the order of options.
- Conflicting combinations (e.g., "nomultichannel,max_channels=3" or
  "multichannel,max_channels=1") are detected and result in an error.
- The number of channels created is consistent with the specified
  options.

This improves the reliability and predictability of mount option
handling for SMB3 multichannel support.

Reviewed-by: Shyam Prasad N <sprasad@microsoft.com>
Signed-off-by: Rajasi Mandal <rajasimandal@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/cifsfs.c
fs/smb/client/fs_context.c
fs/smb/client/fs_context.h