Patch "nfsd: fix refcount leak when file is unhashed after being found" has been added to the 6.1-stable tree

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

 



This is a note to let you know that I've just added the patch titled

    nfsd: fix refcount leak when file is unhashed after being found

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     nfsd-fix-refcount-leak-when-file-is-unhashed-after-b.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit cd9dca1c8497f2d2b0c3b63bd6a54aff0810dc8b
Author: Jeff Layton <jlayton@xxxxxxxxxx>
Date:   Wed Jul 10 09:05:32 2024 -0400

    nfsd: fix refcount leak when file is unhashed after being found
    
    [ 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>

diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c
index 9101ad9175396..9e81f3a9097e0 100644
--- a/fs/nfsd/filecache.c
+++ b/fs/nfsd/filecache.c
@@ -1055,6 +1055,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;
 		goto retry;
 	}




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux