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 38701EB64DD for ; Mon, 26 Jun 2023 21:54:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231824AbjFZVyd (ORCPT ); Mon, 26 Jun 2023 17:54:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231694AbjFZVxm (ORCPT ); Mon, 26 Jun 2023 17:53:42 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AB4319AB; Mon, 26 Jun 2023 14:51:50 -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 E979C60F97; Mon, 26 Jun 2023 21:51:21 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C18CC43397; Mon, 26 Jun 2023 21:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687816281; bh=JYb9Y+H62YdbiRGXrOW39W1rc3+BccB81p+nUiA7wMM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iw8LwDeHeF8ZeeA+LyrOL7Q+QjqlFxY5Ou4DO3muep+rNmOLmbxRYQxEx79sHpyN4 SXDjkYA3agDqKgBC3NRyf8W4vQ6euc8edb+38RnYsnOf97kgwLGUE6fgjpOLJRNJ8B pClrN0Nq1e7q1rz21bOhi+KkGzoPlINuM56zkmiVPDLHZeF+9JvBxszwaf7VsaONRu 0fiFEFhC1XL7HqFj8QRLXH+gfI7KleMMs5FmKostBnr4zKyK1xpIvwjwHR/lQNfclc Ra6YHf346ePVZaXVe4XVcFv5TZuZMHw/VRse2hprZ7xCQodnTP6u/OQwkDV4MPbTRu lztTYV2oU+S1g== 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 5.4 4/6] cifs: add a warning when the in-flight count goes negative Date: Mon, 26 Jun 2023 17:51:14 -0400 Message-Id: <20230626215116.179581-4-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626215116.179581-1-sashal@kernel.org> References: <20230626215116.179581-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 5.4.248 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 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.39.2