From: "Chuck Lever" <cel@kernel.org>
To: "Haoxiang Li" <lihaoxiang@isrc.iscas.ac.cn>,
"Chuck Lever" <chuck.lever@oracle.com>,
"Jeff Layton" <jlayton@kernel.org>, NeilBrown <neil@brown.name>,
"Olga Kornievskaia" <okorniev@redhat.com>,
"Dai Ngo" <Dai.Ngo@oracle.com>, "Tom Talpey" <tom@talpey.com>,
bfields@fieldses.org
Cc: linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] nfsd: Drop the client reference in client_states_open()
Date: Sat, 06 Dec 2025 09:37:44 -0500 [thread overview]
Message-ID: <0ec5a1be-372b-4a0a-9b64-099b1d8bf710@app.fastmail.com> (raw)
In-Reply-To: <20251206073842.196835-1-lihaoxiang@isrc.iscas.ac.cn>
On Sat, Dec 6, 2025, at 2:38 AM, Haoxiang Li wrote:
> In error path, call drop_client() to drop the reference
> obtained by get_nfsdfs_clp().
>
> Fixes: a204f25e372d ("nfsd: create get_nfsdfs_clp helper")
An argument could be made that 78599c42ae3c ("nfsd4: add file
to display list of client's opens") is where the reference
counting was first broken. Would you mind if I updated the
Fixes: tag when I apply this?
> Cc: stable@vger.kernel.org
> Signed-off-by: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>
> ---
> fs/nfsd/nfs4state.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index 8a6960500217..caa0756b6914 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -3097,8 +3097,10 @@ static int client_states_open(struct inode
> *inode, struct file *file)
> return -ENXIO;
>
> ret = seq_open(file, &states_seq_ops);
> - if (ret)
> + if (ret) {
> + drop_client(clp);
> return ret;
> + }
> s = file->private_data;
> s->private = clp;
> return 0;
> --
> 2.25.1
--
Chuck Lever
next prev parent reply other threads:[~2025-12-06 14:38 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-06 7:38 Haoxiang Li
2025-12-06 14:37 ` Chuck Lever [this message]
2025-12-07 8:24 ` Haoxiang Li
2025-12-06 18:43 ` Jeff Layton
2025-12-07 16:16 ` Chuck Lever
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=0ec5a1be-372b-4a0a-9b64-099b1d8bf710@app.fastmail.com \
--to=cel@kernel.org \
--cc=Dai.Ngo@oracle.com \
--cc=bfields@fieldses.org \
--cc=chuck.lever@oracle.com \
--cc=jlayton@kernel.org \
--cc=lihaoxiang@isrc.iscas.ac.cn \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-nfs@vger.kernel.org \
--cc=neil@brown.name \
--cc=okorniev@redhat.com \
--cc=stable@vger.kernel.org \
--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
all inboxes | Powered by JetHome®