]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
nfsd: fix refcount leak when file is unhashed after being found
authorJeff Layton <jlayton@kernel.org>
Wed, 10 Jul 2024 13:05:32 +0000 (09:05 -0400)
committerChuck Lever <chuck.lever@oracle.com>
Sun, 1 Sep 2024 14:04:54 +0000 (10:04 -0400)
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@kernel.org>
Tested-by: Youzhong Yang <youzhong@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/filecache.c

index 9d7bb65b07463ac0e521b152e8a6581984449976..6af4e6027227f902cbdeeb6574b28fc1630d6297 100644 (file)
@@ -1051,6 +1051,7 @@ wait_for_construction:
                        status = nfserr_jukebox;
                        goto construction_err;
                }
+               nfsd_file_put(nf);
                open_retry = false;
                fh_put(fhp);
                goto retry;