{"id":2222818,"url":"http://patchwork.ozlabs.org/api/1.2/patches/2222818/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260413191110.1508848-2-henrique.carvalho@suse.com/","project":{"id":12,"url":"http://patchwork.ozlabs.org/api/1.2/projects/12/?format=json","name":"Linux CIFS Client","link_name":"linux-cifs-client","list_id":"linux-cifs.vger.kernel.org","list_email":"linux-cifs@vger.kernel.org","web_url":"","scm_url":"","webscm_url":"","list_archive_url":"","list_archive_url_format":"","commit_url_format":""},"msgid":"<20260413191110.1508848-2-henrique.carvalho@suse.com>","list_archive_url":null,"date":"2026-04-13T19:11:10","name":"[2/2] smb: client: pass correct from_reconnect to cifs_put_tcp_session()","commit_ref":null,"pull_url":null,"state":"new","archived":false,"hash":"d695d95b70d9775b193ce8ff8c60d04caec0a578","submitter":{"id":89563,"url":"http://patchwork.ozlabs.org/api/1.2/people/89563/?format=json","name":"Henrique Carvalho","email":"henrique.carvalho@suse.com"},"delegate":null,"mbox":"http://patchwork.ozlabs.org/project/linux-cifs-client/patch/20260413191110.1508848-2-henrique.carvalho@suse.com/mbox/","series":[{"id":499742,"url":"http://patchwork.ozlabs.org/api/1.2/series/499742/?format=json","web_url":"http://patchwork.ozlabs.org/project/linux-cifs-client/list/?series=499742","date":"2026-04-13T19:11:10","name":"[1/2] smb: client: serialize channel scaling path","version":1,"mbox":"http://patchwork.ozlabs.org/series/499742/mbox/"}],"comments":"http://patchwork.ozlabs.org/api/patches/2222818/comments/","check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/2222818/checks/","tags":{},"related":[],"headers":{"Return-Path":"\n <linux-cifs+bounces-10784-incoming=patchwork.ozlabs.org@vger.kernel.org>","X-Original-To":["incoming@patchwork.ozlabs.org","linux-cifs@vger.kernel.org"],"Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=suse.com header.i=@suse.com header.a=rsa-sha256\n header.s=google header.b=J3yExkq/;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org\n (client-ip=2600:3c09:e001:a7::12fc:5321; helo=sto.lore.kernel.org;\n envelope-from=linux-cifs+bounces-10784-incoming=patchwork.ozlabs.org@vger.kernel.org;\n receiver=patchwork.ozlabs.org)","smtp.subspace.kernel.org;\n\tdkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com\n header.b=\"J3yExkq/\"","smtp.subspace.kernel.org;\n arc=none smtp.client-ip=209.85.128.50","smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=suse.com","smtp.subspace.kernel.org;\n spf=pass smtp.mailfrom=suse.com"],"Received":["from sto.lore.kernel.org (sto.lore.kernel.org\n [IPv6:2600:3c09:e001:a7::12fc:5321])\n\t(using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n\t key-exchange x25519 server-signature ECDSA (secp384r1) server-digest SHA384)\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4fvcV63CLQz1xtJ\n\tfor <incoming@patchwork.ozlabs.org>; Tue, 14 Apr 2026 05:12:14 +1000 (AEST)","from smtp.subspace.kernel.org (conduit.subspace.kernel.org\n [100.90.174.1])\n\tby sto.lore.kernel.org (Postfix) with ESMTP id 4D470301CAA7\n\tfor <incoming@patchwork.ozlabs.org>; Mon, 13 Apr 2026 19:11:55 +0000 (UTC)","from localhost.localdomain (localhost.localdomain [127.0.0.1])\n\tby smtp.subspace.kernel.org (Postfix) with ESMTP id D8ED62F8BC3;\n\tMon, 13 Apr 2026 19:11:42 +0000 (UTC)","from mail-wm1-f50.google.com (mail-wm1-f50.google.com\n [209.85.128.50])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))\n\t(No client certificate requested)\n\tby smtp.subspace.kernel.org (Postfix) with ESMTPS id 61F0D37EFFA\n\tfor <linux-cifs@vger.kernel.org>; Mon, 13 Apr 2026 19:11:41 +0000 (UTC)","by mail-wm1-f50.google.com with SMTP id\n 5b1f17b1804b1-488ad135063so46111525e9.0\n        for <linux-cifs@vger.kernel.org>;\n Mon, 13 Apr 2026 12:11:41 -0700 (PDT)","from precision ([2804:7f0:6401:5290:433e:afae:f475:c9f7])\n        by smtp.gmail.com with ESMTPSA id\n 5a478bee46e88-2d55f5c6afdsm17508032eec.4.2026.04.13.12.11.36\n        (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n        Mon, 13 Apr 2026 12:11:38 -0700 (PDT)"],"ARC-Seal":"i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;\n\tt=1776107502; cv=none;\n b=TZumbtxv6FeRT+aRLsRNopOodrGpmAXNFN51efekOjHaTJtrwUZG6LTm0if5ltq7sxqDmmPTN7laAOyyN7X7Zf/j17USTbCBHQfX2xjXl8j/Ux/OrJ/12LBHwPkhCo04LY5xQU+i/1xI6N3Tk7yjNVbvT9gwwe9vS6UdgsiJ9+Q=","ARC-Message-Signature":"i=1; a=rsa-sha256; d=subspace.kernel.org;\n\ts=arc-20240116; t=1776107502; c=relaxed/simple;\n\tbh=f9oCGipDy6RcLee8mwGZHQR7Mqjd2U38RG0Ya7eHqI0=;\n\th=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References:\n\t MIME-Version;\n b=a2TxeVnl6IBIQGHU2a47TZ+LWBVr7nQCc5toUu6Kl0Na3PkF8VICftmtAxw7X27ml7rjkvlGqIaHpxMXb1myYLOW/UOfgR5f+8P7QAnpxZNZyvXO3urc9pLU+ThbXTpEcsQsu2dv8SrB1ytYQjcO151z5h/jRxaKWH1rStx7+AI=","ARC-Authentication-Results":"i=1; smtp.subspace.kernel.org;\n dmarc=pass (p=quarantine dis=none) header.from=suse.com;\n spf=pass smtp.mailfrom=suse.com;\n dkim=pass (2048-bit key) header.d=suse.com header.i=@suse.com\n header.b=J3yExkq/; arc=none smtp.client-ip=209.85.128.50","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=suse.com; s=google; t=1776107500; x=1776712300;\n darn=vger.kernel.org;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n         :message-id:reply-to;\n        bh=3nCfqvin2GADlXqoFK8yPp3FrJJtNV6XYhevnyEsvuc=;\n        b=J3yExkq/eUdMKl/tyHfOCOOcCpVY0AhMLrU1K6qAW8AoQfiUMsHzAaBMD7aaJpWqMA\n         5b2lMpJvSZ2iEGqAcgDM6KcHFXr9EJClp7rzJ6VACq+YKep3p++aF00kaqg/NZj3t600\n         UD+b3J+J2rpEqtGO8Jg/b7e7f11UjTxK9rNLBZbYvscr14t2eEzrLWMvM09qSn8NZaqJ\n         Cffy4MVAqm4ENslu71GGnEscMZqdnDr6ACHqHFyj1XuKmIjiJNzuqqZsJHCBLg3sgVRe\n         mcXDgadBqisFy1zM1B2v0OxQ8B43rjQNWCsGJ8jlpZzql0BKJ8pUpUSclL7YfCaNq3rl\n         WkZQ==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n        d=1e100.net; s=20251104; t=1776107500; x=1776712300;\n        h=content-transfer-encoding:mime-version:references:in-reply-to\n         :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from\n         :to:cc:subject:date:message-id:reply-to;\n        bh=3nCfqvin2GADlXqoFK8yPp3FrJJtNV6XYhevnyEsvuc=;\n        b=b7R8fGlGUxEHkLPlQFkjeJJ36eGyuzrZpP7sQXQhDtFGSFY5+RW+x9F99/b0IEJn5M\n         86ttFhR8Rj4wCluuXHLeD5bMA0GZaUxb7zka2/Ko42iEThKlxRdfU6ni24L4DsYasnYb\n         BB0z7BJrbFiJihBrCjW3U5Wr8U6wcXUBkaO+yVHc0ylYG1d/Nqm+MJcRInr9Pye82skI\n         S8tF2qhv8dCqf99LyZmR/JRDElYjmxxwPpVtoLAk7m8Q6081GmEy57Ah3KmnnLC/LQjV\n         oSRZ9NezbmNMNjobZq7BCJy5YENEQpAVAd1a4LXha3K1+simugItL7eOe9RZdWeJoOQG\n         NKMg==","X-Forwarded-Encrypted":"i=1;\n AFNElJ/Cu/su9qwyUhk8IhVTnzxDKP8KSEDlhAw0OgJJrv430GmLhJYXP2UlEb/3yquAFCpQXEP2YGg1wA2G@vger.kernel.org","X-Gm-Message-State":"AOJu0YyBA64AQ1B26x03QD7z+edBSXnngreWb/e/fpFd7lKRAcVJfsBx\n\tnS7SpoqcQ05wO7xgfRiWadIskQpFUvT8HmcOzCtnzGz4JeU/RrvgTtCS11bYPbiCB2Y=","X-Gm-Gg":"AeBDievcu24bMYcXT6j5xYPYdnH1pMrjLGBlZIUFdU1y+MsSXhvW0t3gJCZeigUo8B0\n\tX/YWAVem66DrpCBY46Rj3oXkCpnnXgFu8y+JmuJTBYXPiHXsYzPRWocAg9F1VJURa/nnytqFiwA\n\tb4A04g1qnpnMawGv0swxrGnio4mavqQjpqqOQosiQ/v6JwapwXvyRdqCuICflHkZJUtsRnmfuPT\n\t5uhNAvhvhi7Ta6VUS/gIUKD0imzT8ZNmy9ESirZNFy0DiMLsMRIfqKk4IJxEnwpDGw4znhO8sD9\n\tt1nfvKAOpflRddzQ+Ci6UlUqMMlBCo9GkGaCKeH5l0lXGlChJVcJPomHARajC+6pJCI9RNutLnv\n\tupwyD3kOHS4rN1bQI31hEOH9TBBSgmkJwC1uUo9lJ+sqd37nEIoqh8khXcTC2Ws4oecxGm31XtL\n\tj10sMqf2L+ONSbz8VjOSMlQX5Qa13u2+fTGBvt46J0Ig==","X-Received":"by 2002:a05:600c:8b27:b0:488:af7f:775f with SMTP id\n 5b1f17b1804b1-488d68766c7mr185272365e9.18.1776107499704;\n        Mon, 13 Apr 2026 12:11:39 -0700 (PDT)","From":"Henrique Carvalho <henrique.carvalho@suse.com>","To":"sfrench@samba.org","Cc":"pc@manguebit.org,\n\tronniesahlberg@gmail.com,\n\tsprasad@microsoft.com,\n\ttom@talpey.com,\n\tbharathsm@microsoft.com,\n\tematsumiya@suse.de,\n\tlinux-cifs@vger.kernel.org,\n\tstable@vger.kernel.org","Subject":"[PATCH 2/2] smb: client: pass correct from_reconnect to\n cifs_put_tcp_session()","Date":"Mon, 13 Apr 2026 16:11:10 -0300","Message-ID":"<20260413191110.1508848-2-henrique.carvalho@suse.com>","X-Mailer":"git-send-email 2.53.0","In-Reply-To":"<20260413191110.1508848-1-henrique.carvalho@suse.com>","References":"<20260413191110.1508848-1-henrique.carvalho@suse.com>","Precedence":"bulk","X-Mailing-List":"linux-cifs@vger.kernel.org","List-Id":"<linux-cifs.vger.kernel.org>","List-Subscribe":"<mailto:linux-cifs+subscribe@vger.kernel.org>","List-Unsubscribe":"<mailto:linux-cifs+unsubscribe@vger.kernel.org>","MIME-Version":"1.0","Content-Transfer-Encoding":"8bit"},"content":"cifs_decrease_secondary_channels() tore down removed channels with\nfrom_reconnect=false, even when the shrink was triggered from reconnect\ncontext, which could synchronously wait on reconnect work and break the\nreconnect-side teardown path.\n\nPass down the from_reconnect argument to cifs_put_tcp_session() so\nreconnect-driven channel removal uses the same non-blocking teardown\nsemantics as the rest of the reconnect path.\n\nThis is a minor fix. I believe this bug cannot be triggered in the\ncurrent state of cifs.\n\nFixes: ee1d21794e55 (\"cifs: handle when server stops supporting multichannel\")\nCc: stable@vger.kernel.org\nSigned-off-by: Henrique Carvalho <henrique.carvalho@suse.com>\n---\n fs/smb/client/cifsproto.h | 1 +\n fs/smb/client/sess.c      | 4 ++--\n fs/smb/client/smb2pdu.c   | 2 +-\n 3 files changed, 4 insertions(+), 3 deletions(-)","diff":"diff --git a/fs/smb/client/cifsproto.h b/fs/smb/client/cifsproto.h\nindex 884bfa1cf0b4..b00b2e070ada 100644\n--- a/fs/smb/client/cifsproto.h\n+++ b/fs/smb/client/cifsproto.h\n@@ -374,6 +374,7 @@ bool cifs_chan_needs_reconnect(struct cifs_ses *ses,\n bool cifs_chan_is_iface_active(struct cifs_ses *ses,\n \t\t\t       struct TCP_Server_Info *server);\n void cifs_decrease_secondary_channels(struct cifs_ses *ses,\n+\t\t\t\t      bool from_reconnect,\n \t\t\t\t      bool disable_mchan);\n void cifs_chan_update_iface(struct cifs_ses *ses,\n \t\t\t    struct TCP_Server_Info *server);\ndiff --git a/fs/smb/client/sess.c b/fs/smb/client/sess.c\nindex 698bd27119ae..47bb566c8731 100644\n--- a/fs/smb/client/sess.c\n+++ b/fs/smb/client/sess.c\n@@ -273,7 +273,7 @@ int cifs_try_adding_channels(struct cifs_ses *ses)\n  * Otherwise, it disables all but the primary channel.\n  */\n void\n-cifs_decrease_secondary_channels(struct cifs_ses *ses, bool disable_mchan)\n+cifs_decrease_secondary_channels(struct cifs_ses *ses, bool from_reconnect, bool disable_mchan)\n {\n \tint i, chan_count;\n \tstruct TCP_Server_Info *server;\n@@ -319,7 +319,7 @@ cifs_decrease_secondary_channels(struct cifs_ses *ses, bool disable_mchan)\n \t\t\t\tserver->terminate = true;\n \t\t\t\tcifs_signal_cifsd_for_reconnect(server, false);\n \t\t\t}\n-\t\t\tcifs_put_tcp_session(server, false);\n+\t\t\tcifs_put_tcp_session(server, from_reconnect);\n \t\t}\n \n \t\tspin_lock(&ses->chan_lock);\ndiff --git a/fs/smb/client/smb2pdu.c b/fs/smb/client/smb2pdu.c\nindex 2eb13b2665a4..cf7b74a2b9b0 100644\n--- a/fs/smb/client/smb2pdu.c\n+++ b/fs/smb/client/smb2pdu.c\n@@ -206,7 +206,7 @@ cifs_chan_skip_or_disable(struct cifs_ses *ses,\n \t\treturn -EHOSTDOWN;\n \t}\n \n-\tcifs_decrease_secondary_channels(ses, disable_mchan);\n+\tcifs_decrease_secondary_channels(ses, from_reconnect, disable_mchan);\n \n \treturn 0;\n }\n","prefixes":["2/2"]}