From: Jeff Layton <jlayton@kernel.org>
To: ChenXiaoSong <chenxiaosong@chenxiaosong.com>
Cc: Olga Kornievskaia <okorniev@redhat.com>,
Li Lingfeng <lilingfeng3@huawei.com>,
Dai Ngo <Dai.Ngo@oracle.com>, Neil Brown <neilb@suse.de>,
Chuck Lever <chuck.lever@oracle.com>,
Tom Talpey <tom@talpey.com>,
linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 1/5] nfsd: prevent callback tasks running concurrently
Date: Tue, 10 Jun 2025 07:09:40 -0400 [thread overview]
Message-ID: <208bd615061231c035a5633b29190925f271bd4b.camel@kernel.org> (raw)
In-Reply-To: <23651194C61FBB9C+e2ddd3f5-f51f-44c0-8800-d2abb08a2447@chenxiaosong.com>
On Tue, 2025-06-10 at 16:49 +0800, ChenXiaoSong wrote:
> 在 2025/2/21 00:47, Jeff Layton 写道:
> > Most of the nfsd4_run_cb() callers are converted to use this new flag or
> > the nfsd4_try_run_cb() wrapper. The main exception is the callback
> > channel probe, which has its own synchronization.
> >
>
> Hi Jeff:
>
> We had a null-ptr-deref in nfsd4_probe_callback():
>
> [24225.738349] Unable to handle kernel NULL pointer dereference at
> virtual address 0000000000000000
> ...
> [24225.803480] Call trace:
> [24225.804639] __queue_work+0xb4/0x558
> [24225.805949] queue_work_on+0x88/0x90
> [24225.807306] nfsd4_probe_callback+0x4c/0x58 [nfsd]
> [24225.808896] nfsd4_probe_callback_sync+0x20/0x38 [nfsd]
> [24225.808909] nfsd4_init_conn.isra.57+0x8c/0xa8 [nfsd]
> [24225.815204] nfsd4_create_session+0x5b8/0x718 [nfsd]
> [24225.817711] nfsd4_proc_compound+0x4c0/0x710 [nfsd]
> [24225.819329] nfsd_dispatch+0x104/0x248 [nfsd]
> [24225.820742] svc_process_common+0x348/0x808 [sunrpc]
> [24225.822294] svc_process+0xb0/0xc8 [sunrpc]
> [24225.823760] nfsd+0xf0/0x160 [nfsd]
> [24225.825006] kthread+0x134/0x138
> [24225.826336] ret_from_fork+0x10/0x18
>
> Is this patch or patchset can fix this issue? And I'm having trouble
> understanding the commit message "callback channel probe has its own
> synchronization", I'd appreciate it if you could explain in more detail.
>
Synchronization was probably too strong a word. I remember looking over
this code and convincing myself that the probe callback wasn't subject
to the same races as the others, but I think that was mostly because
the outcome of those races was not harmful. Note that the probe itself
can actually be run at the start of a completely unrelated callback to
the same client.
So you hit a NULL pointer in __queue_work()? The work_struct is
embedded in the nfs4_client so that would probably imply that that the
nfs4_client struct was corrupt?
You may want to get a vmcore and analyze it if you can reproduce this.
--
Jeff Layton <jlayton@kernel.org>
next prev parent reply other threads:[~2025-06-10 11:09 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 16:47 [PATCH v2 0/5] nfsd: don't allow concurrent queueing of workqueue jobs Jeff Layton
2025-02-20 16:47 ` [PATCH v2 1/5] nfsd: prevent callback tasks running concurrently Jeff Layton
2025-06-10 8:49 ` ChenXiaoSong
2025-06-10 11:09 ` Jeff Layton [this message]
2025-06-11 7:12 ` ChenXiaoSong
2025-06-16 7:49 ` ChenXiaoSong
2025-06-16 12:09 ` Jeff Layton
2025-06-16 12:18 ` ChenXiaoSong
2025-02-20 16:47 ` [PATCH v2 2/5] nfsd: eliminate cl_ra_cblist and NFSD4_CLIENT_CB_RECALL_ANY Jeff Layton
2025-02-20 16:47 ` [PATCH v2 3/5] nfsd: replace CB_GETATTR_BUSY with NFSD4_CALLBACK_RUNNING Jeff Layton
2025-02-20 16:47 ` [PATCH v2 4/5] nfsd: move cb_need_restart flag into cb_flags Jeff Layton
2025-02-20 16:47 ` [PATCH v2 5/5] nfsd: handle errors from rpc_call_async() Jeff Layton
2025-02-20 19:21 ` [PATCH v2 0/5] nfsd: don't allow concurrent queueing of workqueue jobs cel
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=208bd615061231c035a5633b29190925f271bd4b.camel@kernel.org \
--to=jlayton@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=chenxiaosong@chenxiaosong.com \
--cc=chuck.lever@oracle.com \
--cc=lilingfeng3@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neilb@suse.de \
--cc=okorniev@redhat.com \
--cc=tom@talpey.com \
/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