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 BBE633CFF6B for ; Mon, 8 Jun 2026 16:53:10 +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=1780937593; cv=none; b=WPiU4XRqVxfc/RDpzw6m/E9J8SWqdo1wvyenyTsLBrFP7/fqg/bgOvsUaIXVngOlMOfb5ZUcErPatywGSIzJ2HUCjCKTRPBnYIlRjdtwJ6Dx8eibJCRlIVt+ZTQ+FGUdaD/TwAqfbi0ov9cVfDlWiy/0QGHLO8iur8LM56/SGk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780937593; c=relaxed/simple; bh=lajAjpnnoujYGkUPN8vIDBCKOYpPLEXuGU9S7aZdnkU=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=S3Hnr2jnFUdzteRdi2s38Ug+lCHlq2nC7oCkhEPjmd2CRa7GSW5G2tGaVcY6IYwymwILlgrUKvsYdKQqQXa/TyyfdClBI9ArkxIzG3jZt+rYafF90ot4H0ChT1J5ZVu69TizWYwzHITm5RsuMPxAShItLiAEYLtC2z0lecCHfac= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=eHN8r6c9; 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="eHN8r6c9" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3B371F00899; Mon, 8 Jun 2026 16:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780937590; bh=X2ZgdLij1/sVQajgSfKAIK8jhMPGr2TnsrqDbVGe1AU=; h=Date:From:To:Cc:In-Reply-To:References:Subject; b=eHN8r6c92FN+3+E4fVx9L1226GabKJOtDq/FZ31NPua1kkYkxsUC7nLJEUsAUCmDi AfhXgE6UxrRCkP5+LTncog+fYvoCpmKb6zNerrM86G/At3/FyO9yIAFCg4jCJ9LmDH tjkfulGD3dw7a/ZZ4GXgz9mgR495iAsyNTlNCX2Phlch50m/mBl9PtbaB0vf73xwpr 5L1M5S2mcC0V+q0XAtteIG5/lVazAZ0iSBjrZjGzPNV4Ray3bzFjUucknLqh6cfgC4 g6WAvuthzLhF6whuXvxfK6WiRExO8t6Mmt3S0/9Moo4MBLu8QCoIwFmrWxQe43kroI pe9WVNb5Tj3zw== Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfauth.phl.internal (Postfix) with ESMTP id 18775F40081; Mon, 8 Jun 2026 12:53:09 -0400 (EDT) Received: from phl-imap-15 ([10.202.2.104]) by phl-compute-10.internal (MEProxy); Mon, 08 Jun 2026 12:53:09 -0400 X-ME-Sender: X-ME-Proxy-Cause: dmFkZTGuxUbHR9LzJEIvgkv9xchPjz+OlD15rjaP2w0bLL4J77GqY2ESJeRrWXx0A0nch2 PIo1PGxqNiZJPC/JlWtE8oDvDWg4NU57KWF3X7eX2VmCRWjl/T5TXDZ2c6SPAD8bDn7nDd QBbWOKV+yTqQP1IAkIAy8mDbds0+TDVEGj5S0pZSZlXfiflBlxOGd2uyUirVO9UlAxRE0v dVOzwGguqZjpNQw+UGwasOWYV/mXVKpvDBGXbf7SRvB33iEMTYiWflQEXxFhauRfLwtfib fc6X9qI02sjmlEoUrU9/WnvXhrWPdEdCBcdgxcw2Nmqq7A67R8qr/BShIqosGunxES0+Gi /nxWwA0fp+91HS7QQ5VS3YU1Gz9dkFn+j1Ky3R6RfcxzbRpxA1wQdRORLQw7RhPuuuDF9/ Pxz2yf6s+8yY5uKu0FTziFlMhBWZxClcRq8xlSsmUV5dyefIvqfQVmsCV4TSaiHBmEX9k+ fx7L2hWjYcALjYr2u7HfW1kEENcD+Q/w1i+ih3AV+QPQjTsLnp7m9K96FOGi8IytVBux5B 3RkoqFMbvbxOTyLWJgTIFgY1oXO47R8d6lDyU0O7P6SMf/avHEjCl3MWyl6QkjxFlSGmoh J6wly4+IBNy3gMM7dVEhwciBD2Mwczk3vEIS48jUMmxXzeByx7SmimMwMfpg X-ME-Proxy: Feedback-ID: ifa6e4810:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id DDA6F780070; Mon, 8 Jun 2026 12:53:08 -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 X-ThreadId: A_rAEqOGWjyN Date: Mon, 08 Jun 2026 12:52:48 -0400 From: "Chuck Lever" To: "Jeff Layton" , "Chuck Lever" , NeilBrown , "Olga Kornievskaia" , "Dai Ngo" , "Tom Talpey" , "Trond Myklebust" , "Anna Schumaker" , "Jonathan Corbet" , "Shuah Khan" Cc: "Steven Rostedt" , "Alexander Aring" , "Amir Goldstein" , "Jan Kara" , "Alexander Viro" , "Christian Brauner" , "Calum Mackay" , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-nfs@vger.kernel.org Message-Id: <35918046-66e3-4361-adc3-bce328ce9821@app.fastmail.com> In-Reply-To: <20260522-dir-deleg-v5-7-542cddfad576@kernel.org> References: <20260522-dir-deleg-v5-0-542cddfad576@kernel.org> <20260522-dir-deleg-v5-7-542cddfad576@kernel.org> Subject: Re: [PATCH v5 07/21] nfsd: add callback encoding and decoding linkages for CB_NOTIFY Content-Type: text/plain Content-Transfer-Encoding: 7bit On Fri, May 22, 2026, at 3:42 PM, Jeff Layton wrote: > Add routines for encoding and decoding CB_NOTIFY messages. These call > into the code generated by xdrgen to do the actual encoding and > decoding. The commit message needs to explain that the encoder is not yet functional. Something like: "The encoder is a stub; payload encoding (stateid, fh, and cna_changes) is deferred." > diff --git a/fs/nfsd/nfs4callback.c b/fs/nfsd/nfs4callback.c > index 25bbf5b8814d..ea3e7deb06fa 100644 > --- a/fs/nfsd/nfs4callback.c > +++ b/fs/nfsd/nfs4callback.c > @@ -865,6 +865,51 @@ static void encode_stateowner(struct xdr_stream > *xdr, struct nfs4_stateowner *so > xdr_encode_opaque(p, so->so_owner.data, so->so_owner.len); > } > > +static void nfs4_xdr_enc_cb_notify(struct rpc_rqst *req, > + struct xdr_stream *xdr, > + const void *data) > +{ > + const struct nfsd4_callback *cb = data; > + struct nfs4_cb_compound_hdr hdr = { > + .ident = 0, > + .minorversion = cb->cb_clp->cl_minorversion, > + }; > + struct CB_NOTIFY4args args = { }; > + > + WARN_ON_ONCE(hdr.minorversion == 0); > + > + encode_cb_compound4args(xdr, &hdr); > + encode_cb_sequence4args(xdr, cb, &hdr); > + > + /* > + * FIXME: get stateid and fh from delegation. Inline the cna_changes > + * buffer, and zero it. > + */ > + WARN_ON_ONCE(!xdrgen_encode_CB_NOTIFY4args(xdr, &args)); > + > + hdr.nops++; > + encode_cb_nops(&hdr); > +} There are a number of problems with this, but since there are no callers yet, we can let some of those issues stand. What is problematic in the longer-term is that this is a client-side encoder (since this is the server's NFSv4 callback client). xdrgen_encode_CB_NOTIFY4args() is an argument encoder, which is client-side functionality, but it resides in fs/nfsd/nfs4xdr_gen.c, which is server-side. Let's not mix these purposes. I replaced the comment and WARN_ON with this: + xdr_stream_encode_u32(xdr, OP_CB_NOTIFY); + + /* FIXME: encode stateid, fh, and cna_changes from delegation */ You can use xdrgen functions for individual data items, but for full argument and response structures, only server-side is supported at the moment. In the later patch that completes this code, I'll cover the other fields, which can be a mix of open code and xdrgen. > diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h > index e1c40f8b5d01..790282781243 100644 > --- a/fs/nfsd/state.h > +++ b/fs/nfsd/state.h > @@ -190,6 +190,13 @@ struct nfs4_cb_fattr { > u64 ncf_cur_fsize; > }; > > +/* > + * FIXME: the current backchannel encoder can't handle a send buffer longer > + * than a single page (see bc_alloc/bc_free). > + */ Nit: The allocator function name is bc_malloc -- Chuck Lever