Linux CIFS filesystem development
 help / color / mirror / Atom feed
* [PATCH 0/5] smb: client: don't sleep through reconnects and umount
@ 2026-12-01 16:50 Stefan Metzmacher
  2026-12-01 16:50 ` [PATCH 1/5] smb: client: stop waiting between reconnect attempts once the server exits Stefan Metzmacher
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stefan Metzmacher @ 2026-12-01 16:50 UTC (permalink / raw)
  To: Paulo Alcantara
  Cc: metze, Namjae Jeon, Ronnie Sahlberg, Shyam Prasad N, Tom Talpey,
	Bharath SM, linux-cifs, samba-technical, linux-kernel, stable

Hi Paulo,

these remove fixed sleeps from the client's reconnect and shutdown
paths, which delayed e.g. an umount after the server or the local
address went away:

  - The reconnect loops slept 3 seconds between attempts, also when
    the server was already exiting; wait on server->response_q
    instead.

  - clean_demultiplex_info() slept 46 seconds if mids were still
    pending; wait until they are gone instead (with the same maximum).

  - Add cifs_server_wait_exiting() and use it for the other sleeps in
    the demultiplex thread and for the replay back-off.

  - Soft mounts give up waiting for the reconnect once the next
    reconnect attempt failed with a local error (e.g. the address was
    removed: -EADDRNOTAVAIL, -ENETUNREACH, -ENETDOWN, -ENODEV) instead
    of 10 seconds per target; short outages like a server restart
    still keep waiting.

The fixed sleeps are gone for all transports. Giving up early on
local errors works for TCP now; for SMB over RDMA it needs smbdirect
to report such errors, which comes with separate changes for
smbdirect.

These patches were developed with the help of Claude (Anthropic),
which was used for code analysis, writing parts of the code and the
commit messages. I reviewed all changes and take full responsibility
for them.

Base: paulo-linux/cifs-next (f5ed6b20ad03).

Stefan Metzmacher (5):
  smb: client: stop waiting between reconnect attempts once the server
    exits
  smb: client: wait for pending mids instead of sleeping 46 seconds
  smb: client: add cifs_server_wait_exiting()
  smb: client: use cifs_server_wait_exiting() for the replay back-off
  smb: client: soft mounts only wait until a reconnect attempt failed
    locally

 fs/smb/client/cached_dir.c |  2 +-
 fs/smb/client/cifsglob.h   |  5 ++++
 fs/smb/client/cifsproto.h  |  2 ++
 fs/smb/client/connect.c    | 61 ++++++++++++++++++++++++++++++++++----
 fs/smb/client/file.c       |  7 +++--
 fs/smb/client/link.c       |  2 +-
 fs/smb/client/misc.c       | 46 +++++++++++++++++++++++-----
 fs/smb/client/smb2inode.c  |  6 ++--
 fs/smb/client/smb2ops.c    |  8 ++---
 fs/smb/client/smb2pdu.c    | 28 ++++++++---------
 fs/smb/client/transport.c  | 16 ++++++++++
 11 files changed, 144 insertions(+), 39 deletions(-)

-- 
2.43.0


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

end of thread, other threads:[~2026-12-01 16:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-01 16:50 [PATCH 0/5] smb: client: don't sleep through reconnects and umount Stefan Metzmacher
2026-12-01 16:50 ` [PATCH 1/5] smb: client: stop waiting between reconnect attempts once the server exits Stefan Metzmacher
2026-12-01 16:50 ` [PATCH 2/5] smb: client: wait for pending mids instead of sleeping 46 seconds Stefan Metzmacher
2026-12-01 16:50 ` [PATCH 3/5] smb: client: add cifs_server_wait_exiting() Stefan Metzmacher
2026-12-01 16:50 ` [PATCH 4/5] smb: client: use cifs_server_wait_exiting() for the replay back-off Stefan Metzmacher
2026-12-01 16:50 ` [PATCH 5/5] smb: client: soft mounts only wait until a reconnect attempt failed locally Stefan Metzmacher

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