]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
nfsd: fix return error code for nfsd_map_name_to_[ug]id
authorAnthony Iliopoulos <ailiop@suse.com>
Mon, 22 Dec 2025 19:30:05 +0000 (14:30 -0500)
committerSasha Levin <sashal@kernel.org>
Wed, 4 Mar 2026 12:21:17 +0000 (07:21 -0500)
commit2eb988d5c8f8e962b2daf41c9f702f849df4ceac
tree2acb8e6518d79aca03413e5b8d3e1eb54a3aacb6
parent6689272b826186b0e9dc099a63bc9ba96ca164e2
nfsd: fix return error code for nfsd_map_name_to_[ug]id

[ Upstream commit 404d779466646bf1461f2090ff137e99acaecf42 ]

idmap lookups can time out while the cache is waiting for a userspace
upcall reply. In that case cache_check() returns -ETIMEDOUT to callers.

The nfsd_map_name_to_[ug]id functions currently proceed with attempting
to map the id to a kuid despite a potentially temporary failure to
perform the idmap lookup. This results in the code returning the error
NFSERR_BADOWNER which can cause client operations to return to userspace
with failure.

Fix this by returning the failure status before attempting kuid mapping.

This will return NFSERR_JUKEBOX on idmap lookup timeout so that clients
can retry the operation instead of aborting it.

Fixes: 65e10f6d0ab0 ("nfsd: Convert idmap to use kuids and kgids")
Cc: stable@vger.kernel.org
Signed-off-by: Anthony Iliopoulos <ailiop@suse.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/nfsd/nfs4idmap.c