Linux NFS development
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Chuck Lever <cel@kernel.org>, NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>, Tom Talpey <tom@talpey.com>,
	Trond Myklebust <trondmy@kernel.org>,
	Anna Schumaker <anna@kernel.org>
Cc: linux-nfs@vger.kernel.org, Chuck Lever <chuck.lever@oracle.com>
Subject: Re: [PATCH 00/38] lockd: Convert NLMv3 server-side procedures to xdrgen
Date: Thu, 14 May 2026 13:57:07 -0400	[thread overview]
Message-ID: <7a5cb8b2664adda42b35f4d42ed184d6987fe075.camel@kernel.org> (raw)
In-Reply-To: <86782884-747e-4796-9961-3407e9fd759f@app.fastmail.com>

On Thu, 2026-05-14 at 13:53 -0400, Chuck Lever wrote:
> On Thu, May 14, 2026, at 12:52 PM, Jeff Layton wrote:
> 
> > I got a sketchy review from Gemini that I had Claude validate that
> > looks valid. You may want to add the memset() it recommends:
> > 
> > --------------8<---------------
> > 
> >   Analysis complete. The previous review (against b201ce7af2a2
> > FREE_ALL) identified the right underlying bug but attributed it to the
> > wrong commit. Here's the corrected analysis:
> > 
> >   Correct commit: 3de744ee4e45 — "lockd: Use xdrgen XDR functions for
> > the NLMv4 TEST procedure"
> > 
> >   The regression: nlm4svc_lookup_file() (introduced in this commit)
> > copies only fh.len bytes of the file handle without zeroing the
> > remainder. Combined with .pc_argzero = 0 removing the
> >   defensive memset of the argument buffer, bytes beyond fh.len in lock-
> > > fh.data contain stale data from previous RPC calls. file_hash() in
> > fs/lockd/svcsubs.c reads a fixed 32 bytes (NFS2_FHSIZE)
> >    regardless of actual handle length, so for handles shorter than 32
> > bytes the hash is non-deterministic — the same file handle can hash to
> > different buckets on different calls, causing lock
> >   state lookup failures.
> 
> This appears to be a regression introduced by the (previous) NLMv4
> series, and does not affect the current NLMv3 xdrgen conversion.
> 
> I can post a fix for this later today. Note that memset() was
> removed as part of the xdrgen conversion because it zeroes much
> more memory than actually needs to be initialized.
> 


I couldn't quite tell. It almost sounded like the change in the
original patch was safe, but this series removed some protections that
made it safe to skip the zeroing? In any case it sounds like a real bug
that we should probably fix, though it can be done in a later patch.

The series itself seems mostly mechanical. You can add:

Reviewed-by: Jeff Layton <jlayton@kernel.org>

      reply	other threads:[~2026-05-14 17:57 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-12 18:13 [PATCH 00/38] lockd: Convert NLMv3 server-side procedures to xdrgen Chuck Lever
2026-05-12 18:13 ` [PATCH 01/38] lockd: Stop warning on nlm__int__drop_reply in !V4 cast_status Chuck Lever
2026-05-12 18:13 ` [PATCH 02/38] lockd: Correct kernel-doc status descriptions for NLMv4 GRANTED Chuck Lever
2026-05-12 18:13 ` [PATCH 03/38] lockd: Drop locks_init_lock() from nlm4_lock_to_lockd_lock() Chuck Lever
2026-05-12 18:13 ` [PATCH 04/38] lockd: Translate nlm__int__deadlock in __nlm4svc_proc_lock_msg() Chuck Lever
2026-05-12 18:13 ` [PATCH 05/38] lockd: Do not monitor when looking up the LOCK_MSG callback host Chuck Lever
2026-05-12 18:13 ` [PATCH 06/38] Documentation: Add the RPC language description of NLM version 3 Chuck Lever
2026-05-12 18:13 ` [PATCH 07/38] lockd: Rename struct nlm_cookie to lockd_cookie Chuck Lever
2026-05-12 18:13 ` [PATCH 08/38] lockd: Rename struct nlm_lock to lockd_lock Chuck Lever
2026-05-12 18:13 ` [PATCH 09/38] lockd: Rename struct nlm_args to lockd_args Chuck Lever
2026-05-12 18:13 ` [PATCH 10/38] lockd: Rename struct nlm_res to lockd_res Chuck Lever
2026-05-12 18:13 ` [PATCH 11/38] lockd: Rename struct nlm_reboot to lockd_reboot Chuck Lever
2026-05-12 18:13 ` [PATCH 12/38] lockd: Rename struct nlm_share to lockd_share Chuck Lever
2026-05-12 18:13 ` [PATCH 13/38] lockd: Use xdrgen XDR functions for the NLMv3 NULL procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 14/38] lockd: Use xdrgen XDR functions for the NLMv3 TEST procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 15/38] lockd: Use xdrgen XDR functions for the NLMv3 LOCK procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 16/38] lockd: Use xdrgen XDR functions for the NLMv3 CANCEL procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 17/38] lockd: Use xdrgen XDR functions for the NLMv3 UNLOCK procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 18/38] lockd: Use xdrgen XDR functions for the NLMv3 GRANTED procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 19/38] lockd: Refactor nlmsvc_callback() Chuck Lever
2026-05-12 18:13 ` [PATCH 20/38] lockd: Use xdrgen XDR functions for the NLMv3 TEST_MSG procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 21/38] lockd: Use xdrgen XDR functions for the NLMv3 LOCK_MSG procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 22/38] lockd: Use xdrgen XDR functions for the NLMv3 CANCEL_MSG procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 23/38] lockd: Use xdrgen XDR functions for the NLMv3 UNLOCK_MSG procedure Chuck Lever
2026-05-12 18:13 ` [PATCH 24/38] lockd: Use xdrgen XDR functions for the NLMv3 GRANTED_MSG procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 25/38] lockd: Use xdrgen XDR functions for the NLMv3 TEST_RES procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 26/38] lockd: Use xdrgen XDR functions for the NLMv3 LOCK_RES procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 27/38] lockd: Use xdrgen XDR functions for the NLMv3 CANCEL_RES procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 28/38] lockd: Use xdrgen XDR functions for the NLMv3 UNLOCK_RES procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 29/38] lockd: Use xdrgen XDR functions for the NLMv3 GRANTED_RES procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 30/38] lockd: Use xdrgen XDR functions for the NLMv3 SM_NOTIFY procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 31/38] lockd: Convert NLMv3 server-side undefined procedures to xdrgen Chuck Lever
2026-05-12 18:14 ` [PATCH 32/38] lockd: Use xdrgen XDR functions for the NLMv3 SHARE procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 33/38] lockd: Use xdrgen XDR functions for the NLMv3 UNSHARE procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 34/38] lockd: Use xdrgen XDR functions for the NLMv3 NM_LOCK procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 35/38] lockd: Use xdrgen XDR functions for the NLMv3 FREE_ALL procedure Chuck Lever
2026-05-12 18:14 ` [PATCH 36/38] lockd: Remove C macros that are no longer used Chuck Lever
2026-05-12 18:14 ` [PATCH 37/38] lockd: Remove dead code from fs/lockd/xdr.c Chuck Lever
2026-05-12 18:14 ` [PATCH 38/38] lockd: Unify cast_status Chuck Lever
2026-05-14 16:52 ` [PATCH 00/38] lockd: Convert NLMv3 server-side procedures to xdrgen Jeff Layton
2026-05-14 17:53   ` Chuck Lever
2026-05-14 17:57     ` Jeff Layton [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7a5cb8b2664adda42b35f4d42ed184d6987fe075.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=anna@kernel.org \
    --cc=cel@kernel.org \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox