]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 4 Oct 2024 14:29:32 +0000 (16:29 +0200)
commita685bc3524f3f03430c97533357a69c26896bdae
treec4cb5a0633a2b6e65d2ea6ff8c342596849816d3
parent982dfdfd59b1a7bdd41dc04c8d0ad28bf1b0c263
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>
fs/nfsd/filecache.c