]> Gentwo Git Trees - linux/.git/commit
cifs: client: allow changing multichannel mount options on remount
authorRajasi Mandal <rajasimandal@microsoft.com>
Fri, 5 Dec 2025 20:11:51 +0000 (20:11 +0000)
committerSteve French <stfrench@microsoft.com>
Fri, 5 Dec 2025 23:14:14 +0000 (17:14 -0600)
commitef529f655a2c9f06b4d1cb8f2b3e577c7f6f7012
tree15d4ff1bac5e0223aabac8b98071da2dd0f42439
parent32a60868093aed5ccaa5e57f3b57f791f22ac133
cifs: client: allow changing multichannel mount options on remount

Previously, the client did not update a session's channel state when
multichannel or max_channels mount options were changed via remount.
This led to inconsistent behavior and prevented enabling or disabling
multichannel support without a full unmount/remount cycle.

Enable dynamic reconfiguration of multichannel and max_channels during
remount by:
- Introducing smb3_sync_ses_chan_max(), a centralized function for
  channel updates which synchronizes the session's channels with the
  updated configuration.
- Replacing cifs_disable_secondary_channels() with
  cifs_decrease_secondary_channels(), which accepts a disable_mchan
  flag to support multichannel disable when the server stops supporting
  multichannel.
- Updating remount logic to detect changes in multichannel or
  max_channels and trigger appropriate session/channel updates.

Current limitation:
- The query_interfaces worker runs even when max_channels=1 so that
  multichannel can be enabled later via remount without requiring an
  unmount. This is a temporary approach and may be refined in the
  future.

Users can safely modify multichannel and max_channels on an existing
mount. The client will correctly adjust the session's channel state to
match the new configuration, preserving durability where possible and
avoiding unnecessary disconnects.

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/cifsproto.h
fs/smb/client/connect.c
fs/smb/client/fs_context.c
fs/smb/client/sess.c
fs/smb/client/smb2pdu.c