From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=144.76.82.148 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796143860; b=gYP3CoMjiP6LpljLwCxBPNUhltxLh8fCH+lt93tdbXc5cwR5HdiroDbSGjBQ7koP+IRr Nxtah6fU6TvgU5aDlOs9eqSf+zl2DdUFFmTHJIdkzy8MYgC18e2EAT9ikqvVijo1rire4 VBr907PZ2vKVbrfNE1xQtM3R2urI+zs05/Fe1HqnfS1SJ7jWPJYIiyHBo2ZZCokLxlKkn v7hmtzQC2MvkpeBQE3Y/4OykBZgRCcdS04+8hHj0lCXCG+IdtikDizRG4wVnHjdQJlAAz /LWoboC4sGxCkd7UbIlRQ/3X+1THXoiZWC0PS8E3FtxMRXqvoSP1wp9y2IImrv8eclQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796143860; h=DMARC-Filter:DKIM-Signature:Received:From:To:Cc:Subject:Date: Message-ID:X-Mailer:MIME-Version:Content-Transfer-Encoding; bh=ubLqR1HXTEyNkXhzLtgzai/Ot5he8Y8AW/ql6ZIUv8E=; b=GYCXDGGqqzar8aLrt2sbXui8bevN3NP4x/LjiD47tV7fjVV4lb0eEvjb9ARgQHOJPBUp 8eIxg80gFBf/JkXLPs1OdjzqdAWiZ9IUjazorY83d9pOoJwY3MyOFEGIyr/14gpzZNRdf F/7QoIWV/1YVQWigaKonqn82nK/eeOM2frvJpas97cUKMs9nWH2eMRnUwrMOYYPSWzkrn 55/7tc/cPBvona+JcfKD59HTYab7vfS/qILM8TO5o/qq+z+W/+hz8MypAE9MP0jg1ehvR X5McnEVFzmLH3cfSxbyPkvEX2cQ7sfOGz5zkweqxrgucIVWUpGHezPq146le0+ccAMA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=samba.org; spf=pass smtp.mailfrom=samba.org; dkim=pass header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=P+jSzzga; arc=none smtp.remote-ip=144.76.82.148 Received: from hr2.samba.org (hr2.samba.org [144.76.82.148]) (using TLSv1.3 with cipher TLS_CHACHA20_POLY1305_SHA256 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DAA05606A31A; Tue, 1 Dec 2026 16:50:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DAA05606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=samba.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=samba.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (3072-bit key) header.d=samba.org header.i=@samba.org header.a=rsa-sha256 header.s=42 header.b=P+jSzzga DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-ID:Date:Cc:To:From; bh=ubLqR1HXTEyNkXhzLtgzai/Ot5he8Y8AW/ql6ZIUv8E=; b=P+jSzzgadeVoKpamn1rnrkj3jW 1XsQ3QexhpGm2W0xnfuHk04elLdRM/N4qW7ZSlKKcXfQLJF4iYP3S/Qj7UUV7fdpcgJePyYoO5PXS sY7Te78LUq6fCZbGq4HukZkEVzzkbN6+XIPN6R7xvOXo0Oexr6Wg4E2b5XwLypSMasE2AagUtI8cT hf+lTxj3JnjXUwgZO3pJBpK/aFGYLjUloicN2mNfmy9tbL+pVyyA+LyVknl+oXtQUi9ZAVhlVUhQF OPWMQE4RKjDJoGQc70Pc5HEy9YVe4hPF/+lorosrh6GdScfz625uZP4f0bHuBOuQpSrNBeR7Y5AOD wUpLM+uZeMdAL8D7pNXrNuaDc2BslQqZ5Wj+rixdk5N04IH9dpD7jNXqmSBYCGXp8HCy/kM6oY4OQ kQoeDnc/axJLDomQh3TdpiBQyZZChE+gscE2M8W9WaxBUwNAhOgl9s2ta0Ny9rdR3WXWBdOmX4Rmi T6ub7wNe4BqG3aPPJZsJKqX5; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__ECDSA_SECP256R1_SHA256__CHACHA20_POLY1305:256) (Exim) id 1xYR4A-00000000Mcx-3zAc; Tue, 01 Dec 2026 16:50:55 +0000 From: Stefan Metzmacher To: Paulo Alcantara Cc: metze@samba.org, Namjae Jeon , Ronnie Sahlberg , Shyam Prasad N , Tom Talpey , Bharath SM , 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 Message-ID: X-Mailer: git-send-email 2.43.0 X-Mailing-List: stable@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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