diff options
author | Jeff Layton <jlayton@kernel.org> | 2024-07-10 09:05:32 -0400 |
---|---|---|
committer | Chuck Lever <chuck.lever@oracle.com> | 2024-09-01 10:04:54 -0400 |
commit | 8a7926176378460e0d91e02b03f0ff20a8709a60 (patch) | |
tree | 5643739511450b1a7d3bfdda7232f2725f009c65 /fs/nfsd | |
parent | 81a95c2b1d605743220f28db04b8da13a65c4059 (diff) |
nfsd: fix refcount leak when file is unhashed after being found
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>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/filecache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/nfsd/filecache.c b/fs/nfsd/filecache.c index 9d7bb65b0746..6af4e6027227 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -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; |