Re: [PATCH 6.11 397/695] nfsd: fix refcount leak when file is unhashed after being found

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



My understanding is that the following 4 commits together fix the leaking issue:

nfsd: add list_head nf_gc to struct nfsd_file
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8e6e2ffa6569a205f1805cbaeca143b556581da6

nfsd: fix refcount leak when file is unhashed after being found
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=8a7926176378460e0d91e02b03f0ff20a8709a60

nfsd: remove unneeded EEXIST error check in nfsd_do_file_acquire
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=81a95c2b1d605743220f28db04b8da13a65c4059

nfsd: count nfsd_file allocations
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=700bb4ff912f954345286e065ff145753a1d5bbe

The first two are essential but it's better to have the last two commits too.

On Wed, Oct 2, 2024 at 9:38 AM Greg Kroah-Hartman
<gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> 6.11-stable review patch.  If anyone has any objections, please let me know.
>
> ------------------
>
> From: Jeff Layton <jlayton@xxxxxxxxxx>
>
> [ Upstream commit 8a7926176378460e0d91e02b03f0ff20a8709a60 ]
>
> If we wait_for_construction and find that the file is no longer hashed,
> and we're going to retry the open, the old nfsd_file reference is
> currently leaked. Put the reference before retrying.
>
> Fixes: c6593366c0bf ("nfsd: don't kill nfsd_files because of lease break error")
> Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
> Tested-by: Youzhong Yang <youzhong@xxxxxxxxx>
> Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
> ---
>  fs/nfsd/filecache.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
> index f09d96ff20652..e2e248032bfd0 100644
> --- a/fs/nfsd/filecache.c
> +++ b/fs/nfsd/filecache.c
> @@ -1049,6 +1049,7 @@ nfsd_file_do_acquire(struct svc_rqst *rqstp, struct svc_fh *fhp,
>                         status = nfserr_jukebox;
>                         goto construction_err;
>                 }
> +               nfsd_file_put(nf);
>                 open_retry = false;
>                 fh_put(fhp);
>                 goto retry;
> --
> 2.43.0
>
>
>





[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux