diff options
| author | Jeff Layton <jlayton@kernel.org> | 2024-07-10 09:05:32 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-10-04 16:29:32 +0200 |
| commit | a685bc3524f3f03430c97533357a69c26896bdae (patch) | |
| tree | c4cb5a0633a2b6e65d2ea6ff8c342596849816d3 /fs/nfsd | |
| parent | 982dfdfd59b1a7bdd41dc04c8d0ad28bf1b0c263 (diff) | |
| download | linux-a685bc3524f3f03430c97533357a69c26896bdae.tar.gz linux-a685bc3524f3f03430c97533357a69c26896bdae.tar.bz2 linux-a685bc3524f3f03430c97533357a69c26896bdae.zip | |
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@kernel.org>
Tested-by: Youzhong Yang <youzhong@gmail.com>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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 88cefb630e17..5c9f8f8404d5 100644 --- a/fs/nfsd/filecache.c +++ b/fs/nfsd/filecache.c @@ -1054,6 +1054,7 @@ wait_for_construction: status = nfserr_jukebox; goto construction_err; } + nfsd_file_put(nf); open_retry = false; fh_put(fhp); goto retry; |
