]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: call cache_put if xdr_reserve_space returns NULL
authorGuoqing Jiang <guoqing.jiang@linux.dev>
Wed, 21 Aug 2024 14:03:18 +0000 (22:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:11:04 +0000 (15:11 +0200)
commit9803ab882d565a8fb2dde5999d98866d1c499dfd
treee01d26bae6b1f997337f17d46dce1c34a532d3cf
parent85a84de8e3602a04417ea3d2b006ef316f3dd723
nfsd: call cache_put if xdr_reserve_space returns NULL

[ Upstream commit d078cbf5c38de83bc31f83c47dcd2184c04a50c7 ]

If not enough buffer space available, but idmap_lookup has triggered
lookup_fn which calls cache_get and returns successfully. Then we
missed to call cache_put here which pairs with cache_get.

Fixes: ddd1ea563672 ("nfsd4: use xdr_reserve_space in attribute encoding")
Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Reviwed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4idmap.c