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 11CC32AB5E for ; Wed, 20 Sep 2023 12:10:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 82BFBC433C8; Wed, 20 Sep 2023 12:10:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1695211852; bh=cQqBXE4YZw/RS9NsRFI3GZ40nRD+Q4ubVffc6WV7oqU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Sr010bjPZcIdkKeftZfl00tl1OCrDPpY8rk3xH227l8GFa9uWJVL8UIWTrmKDbB8G QzRxqFnZWxusY48g9HcLeQbakFCbJ3hUSNhJe1Uac+X+Ql+k/4IdJdFiyRC0wC+X6c TkaKBiSfY61/HGxFUKD7BZgdJKGkGgNYQKQhXk9I= 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 4.19 034/273] cifs: add a warning when the in-flight count goes negative Date: Wed, 20 Sep 2023 13:27:54 +0200 Message-ID: <20230920112847.475174210@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230920112846.440597133@linuxfoundation.org> References: <20230920112846.440597133@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 4.19-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 c07dcb2af2eb8..01ab4496cb897 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -79,6 +79,7 @@ smb2_add_credits(struct TCP_Server_Info *server, const unsigned int add, *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