From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6533DEB64D9 for ; Mon, 26 Jun 2023 22:05:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230437AbjFZWFH (ORCPT ); Mon, 26 Jun 2023 18:05:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52156 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232017AbjFZWEc (ORCPT ); Mon, 26 Jun 2023 18:04:32 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0763059DF; Mon, 26 Jun 2023 15:00:43 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id E3D8060FA2; Mon, 26 Jun 2023 21:51:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1FBE4C433D9; Mon, 26 Jun 2023 21:51:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687816288; bh=6Mh8M0FZA5XVMqAaQGjiN4GbFyo8g3GFDwp31EbEqOg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NwhACk4qB1/gmQiDJWt7WAQcFSbADbNGJ/c4Ym7SK2A43Fz8EpcMbpkigKtZvnjKc bAyGHgeoh+Z9OVvQPj7ktA93kbJEFe0khTfxS2bXNJj1tGDxEikeikjGMxGG6l/zJC XoS2/OkFx07dFy5EUkPQ8cKy557AkIjKbPHcFv1Ck12dU05eBqDc3h9BjtfAiXxu9j ShE6ZVXuPrp4z9/SL1lyZj4VFPnHw2egeI/kjdEAFssaWhlJcQY67gubnTVerZtVM1 xE9ukNpZCB0Adjc8m7U7baDFqj1Q3s6jb2rS622Y/gbcKoQdAo5tgdQHowGlSGmkT3 l68CJoNpsZwpA== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Shyam Prasad N , Bharath SM , Steve French , Sasha Levin , pc@cjr.nz, lsahlber@redhat.com, dhowells@redhat.com, ematsumiya@suse.de, pc@manguebit.com, vl@samba.org Subject: [PATCH AUTOSEL 4.19 4/5] cifs: add a warning when the in-flight count goes negative Date: Mon, 26 Jun 2023 17:51:23 -0400 Message-Id: <20230626215124.179666-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626215124.179666-1-sashal@kernel.org> References: <20230626215124.179666-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 4.19.287 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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.39.2