From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EBC0E30FA7 for ; Wed, 20 Sep 2023 12:27:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 71F79C433C9; Wed, 20 Sep 2023 12:27:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695212839; bh=KbcKWiASVe8AzHizMsqCAebbm99hFQmSSn38px/qYFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vDfufOaMDOUd6sZTs2aeVTDf5b9csQVkO5bXwH04PjLTHm0LpqIhboCdKilYif+9f hPLg4c4qeC6hRQymV6mnwoQP4V7lb40y77U5fpnCvp+k2PZtzgIpK6D2VK+3IaEkIo QcZ4D1bHWd6BrPxd5i9LrG8TbrFlyC94twuQll8Y= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Shyam Prasad N , Bharath SM , Steve French , Sasha Levin Subject: [PATCH 5.4 039/367] cifs: add a warning when the in-flight count goes negative Date: Wed, 20 Sep 2023 13:26:56 +0200 Message-ID: <20230920112859.518128353@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112858.471730572@linuxfoundation.org> References: <20230920112858.471730572@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Shyam Prasad N [ Upstream commit e4645cc2f1e2d6f268bb8dcfac40997c52432aed ] We've seen the in-flight count go into negative with some internal stress testing in Microsoft. Adding a WARN when this happens, in hope of understanding why this happens when it happens. Signed-off-by: Shyam Prasad N Reviewed-by: Bharath SM Signed-off-by: Steve French Signed-off-by: Sasha Levin --- fs/cifs/smb2ops.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index cd0030533bf7a..ad9b207432e10 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -79,6 +79,7 @@ smb2_add_credits(struct TCP_Server_Info *server, *val = 65000; /* Don't get near 64K credits, avoid srv bugs */ printk_once(KERN_WARNING "server overflowed SMB3 credits\n"); } + WARN_ON_ONCE(server->in_flight == 0); server->in_flight--; if (server->in_flight == 0 && (optype & CIFS_OP_MASK) != CIFS_NEG_OP) rc = change_conf(server); -- 2.40.1