Skip to content

smb: client: make more mount options take effect on remount

[email protected] linux-cifs lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest7 patches 5 repliesIn review
  2. v39 patches 4 repliesSuperseded

Changes in v4 from the cover letter

- nolease: moved tcon->no_lease out of the bitfield word into a plain bool, so propagating it on remount cannot race (via a bitfield read-modify-write) with the lockless need_reconnect/need_reopen_files writers on the reconnect/reopen paths.
- srcaddr remount check now uses cifs_match_ipaddr() instead of a raw memcmp over sockaddr_storage, matching the adjacent ip check and avoiding port/padding fragility.

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7smb: client: sync runtime state into ctx on reconfigurefs/smb/client/cifs_swn.h fs/smb/client/fs_context.c fs/smb/client/smb1ops.c +1 more+139 -41 reply
2/7smb: client: block non-reconfigurable option changes on remountfs/smb/client/fs_context.c+141 -01 reply
3/7smb: client: sync retrans on remountfs/smb/client/fs_context.c+20 -01 reply
4/7smb: client: block cache=ro and cache=singleclient on remountfs/smb/client/fs_context.c+9 -01 reply
5/7smb: client: apply rasize on remountfs/smb/client/fs_context.c+9 -21 reply
6/7smb: client: move struct tcon_list to cifsglob.hfs/smb/client/cifsglob.h fs/smb/client/misc.c+5 -50 replies
7/7smb: client: allow nolease option to be reconfigured on remountfs/smb/client/cached_dir.c fs/smb/client/cached_dir.h fs/smb/client/cifsglob.h +2 more+88 -10 replies

Reviews trailers per patch

All 7 patches have a Reviewed-by or Acked-by.

PatchMeetakshi SetiyaBharath SM
1/7R-b R-b
2/7R-b R-b
3/7R-b R-b
4/7R-b R-b
5/7R-b R-b
6/7R-b
7/7R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/7] smb: client: make more mount options take effect on remount

From: Rajasi Mandal <[email protected]>

Several mount options are accepted by the remount (reconfigure) path but silently have no effect: the new value is stored in cifs_sb->ctx but never propagated to the live server/tcon structures, or the option is simply ignored. This is confusing -- the user passes an option on 'mount -o remount' and nothing changes, with no error.

This series makes the reconfigure path honest:

- It first establishes a correct baseline for comparing old vs new options on remount by duplicating the live context (with runtime state synced in) instead of rebuilding from init defaults.

- Options that are genuinely reconfigurable (retrans, rasize, nolease) are now applied to the running mount.

- Options that are connection-tied and cannot take effect without tearing down the connection (seal, sign, vers, ip, srcaddr, rdma, cache=ro/singleclient, etc.) are now explicitly rejected with a clear error message instead of being silently dropped.

Patch 1 is preparatory plumbing (duplicate live ctx + sync runtime state) that makes the simple != comparisons in the rejection checks sound. Patches 2 and 4 add the rejection checks. Patches 3, 5 and 7 apply the reconfigurable options. Patch 6 is a small no-functional-change move of struct tcon_list so the nolease patch can reuse it.

Changes since v3:
- nolease: moved tcon->no_lease out of the bitfield word into a plain bool, so propagating it on remount cannot race (via a bitfield read-modify-write) with the lockless need_reconnect/need_reopen_files writers on the reconnect/reopen paths.
- srcaddr remount check now uses cifs_match_ipaddr() instead of a raw memcmp over sockaddr_storage, matching the adjacent ip check and avoiding port/padding fragility.

Rajasi Mandal (7):
smb: client: sync runtime state into ctx on reconfigure
smb: client: block non-reconfigurable option changes on remount
smb: client: sync retrans on remount
smb: client: block cache=ro and cache=singleclient on remount
smb: client: apply rasize on remount
smb: client: move struct tcon_list to cifsglob.h
smb: client: allow nolease option to be reconfigured on remount

 fs/smb/client/cached_dir.c |  44 +++++
 fs/smb/client/cached_dir.h |   1 +
 fs/smb/client/cifs_swn.h   |  14 +-
 fs/smb/client/cifsglob.h   |   7 +-
 fs/smb/client/fs_context.c | 332 ++++++++++++++++++++++++++++++++++++-
 fs/smb/client/misc.c       |   5 -
 fs/smb/client/smb1ops.c    |   7 +-
 fs/smb/client/smb2pdu.c    |  11 +-
 fs/smb/client/trace.h      |   2 +
 9 files changed, 411 insertions(+), 12 deletions(-)

base-commit: 0eb17dea51eff940230b5e562df29ce457124d41

Signature · 1 line
2.43.0