From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 6A9831FD4 for ; Fri, 19 Jun 2026 00:12:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781827978; cv=none; b=UXpcjYofOp8ugo5cdu4Q+GsmDoUnWVhd/ndPlBHkgVMAVu3onkcfjTxkVpbmIRgd1pbj0eb0wCYT9hQzabp3jAdN5iz+LyPch+UFiiMH98an4Ko6acvpe0DSSCbjpE9V9sZlf0MZxSiPA2kzZnE8u1ZRznnm/qiYkbj8Ti/qNUU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781827978; c=relaxed/simple; bh=UotpaL3rRvmTQDJCZfdeyvmtOAzaEV5m7folSrafRhk=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=DcUr9d2AZfPwQXZK2h55ESCwmXYNApeeBalYIDZK9KNPEuRQEuIH/rOOLrpebWH/h4HAl5ZqdL86gl7VFZTKeIOE0wyfC2d4hYl2kj5J5WJ7ZYYKghvL3/ZhaSHxifY/TsSXjIPH1DOXdH2DRq4HOcEU0JDgkrjkUa2TC7L4PyA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=QlNVtxOd; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="QlNVtxOd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D02241F00A3D; Fri, 19 Jun 2026 00:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1781827977; bh=DrVV5uN8r7v2I+QYSQO25A2eIY+MsOPpe8409I7IsxA=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=QlNVtxOddRzx03i8Gh79h5uDyLh/lIAK7bhFzP/wb+LQFRg20aeFCLNXa40/qeQLS KtP0ZpzDBBsU956zuMEkwnC+hRVF4cME2muNVX0xr2RTzyQGW6f/wZ0tjurHiPk8Po wV13s8v97Piw8XIoBDUEasCLVGlHHXQu68fec5eOcKgjCWYNCAu+4MM14nx7bo1fNU v/0czz9p0ql72EAiNvUDCDAxEuoex3J4Zyj1oGRKTJEZpDYm+0U3s77mYBtHhzlChf mvGEtGRlcYcXK+EBpdy4wqIPn/CoJLOxjem/WJxybaCUymVOnwTEzo54O1yqjKYJc6 ZfOmX/FD3Xc+Q== Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id F06BFF40071; Thu, 18 Jun 2026 20:12:55 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-10.internal (MEProxy); Thu, 18 Jun 2026 20:12:55 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTFFgGMJmX8Os2wj0nlRvJBoJg8BoZ0wj6ibv8STLwBWkKPXny219PscUL5sc+WKFf yOUDVXCy02DARhZmQre8f+p90oJRUCV62nPpEiipAQm+8Jumtmrenn1FyElXw0rthfPcKo ludpbBqGI0wRVMsGXgds+Jah+9n78MEn9udMZ6zdHPGcwqsE97XRoa++1qntyEyblnq5wS R2FZi+PdvCyDjjeXtqRzJo9RhSemvgFpLcWce4/1B8df9yFY/Prv2ObZd7YvsVexwZcGmL b9ZP5e9CK+UXbfe9DhHra3X5Lb3GhxOPG3lq0/72FCeWV5tkjPyVSqg5kxLsY5MgW6u1ZA Hfr0xa2YrqeCJpj2HHDnJa4sn54bAYiSbktS1iJUg3HcR9uVmtJXB7bOdF37g6iLgFmnkX CZl5QhnhYRtRLGlX6gXyy08hOpXoRHP39SB4A306tPnrduF6WsTCEyB8S8RM/HXjZEbkXr YqFYHU5GeNJ4p8q4W6bwzos8vwvR816O7WVAIO5t1k56uJWSjZGFhqPtv3bA36cFo/BpzD bxrTqX9GWu95KgovTctr129M+25TAIz+vEsSTJK15+Ty+AdWOS095pCSxgjeI6WwZX5k+X 67FJdKZlhjWQtaTDAJzG3eNhmXJaLqnIQZKgPgDJQPMMpw5fLhY+6Lh3LioQ X-ME-Proxy: Feedback-ID: ifa6e4810:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id CBBA57809DB; Thu, 18 Jun 2026 20:12:55 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Date: Thu, 18 Jun 2026 20:12:34 -0400 From: "Chuck Lever" To: "Jeff Layton" , NeilBrown , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" Cc: "Trond Myklebust" , "Anna Schumaker" , "Steve Dickson" , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Message-Id: <9847a194-22e9-49d7-8729-6dc31475d203@app.fastmail.com> In-Reply-To: <20260618-exportd-netlink-v5-5-e9aef947af3d@kernel.org> References: <20260618-exportd-netlink-v5-0-e9aef947af3d@kernel.org> <20260618-exportd-netlink-v5-5-e9aef947af3d@kernel.org> Subject: Re: [PATCH v5 5/6] nfsd: count NFSv4 callback operations per netns Content-Type: text/plain Content-Transfer-Encoding: 7bit On Thu, Jun 18, 2026, at 12:57 PM, Jeff Layton wrote: > The NFS server tracks per-operation call counts for the forward channel > (proc4ops) but keeps no statistics for the NFSv4 backchannel (callback) > operations it sends to clients. > > Add a per-netns array of percpu counters for callback operations, indexed > by RFC 8881 callback opcode (OP_CB_GETATTR..OP_CB_OFFLOAD), and bump the > relevant counter in nfsd4_run_cb(), which is hit exactly once per callback > that is actually queued. > > CB_GETATTR is sent when a GETATTR conflicts with an outstanding write > delegation, which is roughly what the dedicated wdeleg_getattr counter > tracked. The two are not identical: the old counter incremented on every > such conflict, whereas the CB_GETATTR counter only counts callbacks that > are actually queued, so concurrent conflicts that coalesce onto an > already in-flight CB_GETATTR are now counted once rather than once per > conflict. Report the procfs "wdeleg_getattr" line from the CB_GETATTR > counter and drop the now-redundant NFSD_STATS_WDELEG_GETATTR counter, its > helper, and its increment site. > > Assisted-by: Claude:claude-opus-4-8 > Signed-off-by: Jeff Layton > --- > fs/nfsd/netns.h | 12 +++++++++++- > fs/nfsd/nfs4callback.c | 7 ++++++- > fs/nfsd/nfs4state.c | 2 -- > fs/nfsd/nfsctl.c | 14 ++++++++++++++ > fs/nfsd/stats.c | 2 +- > fs/nfsd/stats.h | 5 +++-- > 6 files changed, 35 insertions(+), 7 deletions(-) I agree with the Sashiko review that this patch introduces a UAF possibility that needs to be addressed before the patch is applied. -- Chuck Lever