mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@kernel.org>
To: Haoxiang Li <lihaoxiang@isrc.iscas.ac.cn>,
	chuck.lever@oracle.com,  neil@brown.name, okorniev@redhat.com,
	Dai.Ngo@oracle.com, 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: Sun, 07 Dec 2025 03:43:04 +0900	[thread overview]
Message-ID: <4263ceeab14cb5fdc8b0cc90496648ca195cbc8e.camel@kernel.org> (raw)
In-Reply-To: <20251206073842.196835-1-lihaoxiang@isrc.iscas.ac.cn>

On Sat, 2025-12-06 at 15:38 +0800, 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")
> 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;

Nice catch.

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

  parent reply	other threads:[~2025-12-06 18:43 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
2025-12-07  8:24   ` Haoxiang Li
2025-12-06 18:43 ` Jeff Layton [this message]
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=4263ceeab14cb5fdc8b0cc90496648ca195cbc8e.camel@kernel.org \
    --to=jlayton@kernel.org \
    --cc=Dai.Ngo@oracle.com \
    --cc=bfields@fieldses.org \
    --cc=chuck.lever@oracle.com \
    --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

Powered by JetHome