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 1AA38EB64D7 for ; Mon, 26 Jun 2023 21:50:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229481AbjFZVus (ORCPT ); Mon, 26 Jun 2023 17:50:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231127AbjFZVu2 (ORCPT ); Mon, 26 Jun 2023 17:50:28 -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 C14261FD9; Mon, 26 Jun 2023 14:50:16 -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 4D3AB60F51; Mon, 26 Jun 2023 21:50:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91579C433C8; Mon, 26 Jun 2023 21:50:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687816215; bh=8FUXU+LQRLsTwQlXFKmnbcf8jI/b7JirHp4cZDvwkLg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d/4NiEMs8ulnIzU7ulRkH5NE3FAidLuuJTGKpr/BJ78B4mV279Ny9HcjtomXVelum TV172kfKBitBzqtxSXqqInnlJLoD8BshE5ZaTAjWoRI0xaRRQq5RrD1e+otkVbyceS EkfWghyEnBpkWR42hPUGic5GKraZUCQJFzH2rw11TTmC3NFA9KIDeGR2xggF4faMYn qryhbY1zu2u/ODE3tew/N+yNuXjRC1IFa7wM8uaA/Pce4QBgPYLfTrVzwyC1M7Q2le yKj5gBXXwHH3yMeVcVysEB+oJt202vd+R3xr7qoYootJJjZaGiQiU1jjVQf7igCsQE nhAKAOgrrYM1Q== 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 6.3 09/16] cifs: add a warning when the in-flight count goes negative Date: Mon, 26 Jun 2023 17:49:49 -0400 Message-Id: <20230626214956.178942-9-sashal@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230626214956.178942-1-sashal@kernel.org> References: <20230626214956.178942-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore X-stable-base: Linux 6.3.9 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 fd00c9717aef9..2dfc396a4cc79 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -93,6 +93,7 @@ smb2_add_credits(struct TCP_Server_Info *server, server->conn_id, server->hostname, *val, add, server->in_flight); } + WARN_ON_ONCE(server->in_flight == 0); server->in_flight--; if (server->in_flight == 0 && ((optype & CIFS_OP_MASK) != CIFS_NEG_OP) && -- 2.39.2