The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Stefan Metzmacher <metze@samba.org>
To: Paulo Alcantara <pc@manguebit.org>
Cc: metze@samba.org, Namjae Jeon <linkinjeon@kernel.org>,
	Ronnie Sahlberg <ronniesahlberg@gmail.com>,
	Shyam Prasad N <sprasad@microsoft.com>,
	Tom Talpey <tom@talpey.com>, Bharath SM <bharathsm@microsoft.com>,
	linux-cifs@vger.kernel.org, samba-technical@lists.samba.org,
	linux-kernel@vger.kernel.org, stable@vger.kernel.org
Subject: [PATCH 0/5] smb: client: don't sleep through reconnects and umount
Date: Tue,  1 Dec 2026 17:50:41 +0100	[thread overview]
Message-ID: <cover.1796142565.git.metze@samba.org> (raw)

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


             reply	other threads:[~2026-12-01 16:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-01 16:50 Stefan Metzmacher [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cover.1796142565.git.metze@samba.org \
    --to=metze@samba.org \
    --cc=bharathsm@microsoft.com \
    --cc=linkinjeon@kernel.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pc@manguebit.org \
    --cc=ronniesahlberg@gmail.com \
    --cc=samba-technical@lists.samba.org \
    --cc=sprasad@microsoft.com \
    --cc=stable@vger.kernel.org \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox