From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 76DC32D3EEA; Sun, 1 Mar 2026 01:43:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329435; cv=none; b=n2wy8Ou1z495KCAITsq0nMovC1rpXIlJNaKBYmxKnxb7O9sz82WHp0J37n/x4ZyP/TbgLK44f5l+KgsK/UCQpn4HRxFsnzaLT0P2eyeJ3hCJUJO8bmFXWFj+9RAv8TV8y0t+kio7Ntwbyh0UoQ8Mn8laDZ/sbCn4Nd/+McOY9oA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772329435; c=relaxed/simple; bh=2qqGh2OE1JNTiMshtbDgeDg4zT3BE7VTeDI+ucEI6DQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VFEf3czlJNayn4POtguCKmWc2WOtpgWLqiFaqnR/mLi65mgDqtsMakQsh9Q4UCSYhrGhoDL+VqMZ6/+99pTGS6E1umc2RXtRaa3Hq3/WBAbZLGCACXKqlZlk+v/Y5FJyjolddubTFa0OGOXaLGj3XfJkHRvu9DXOY6pWQKQPNTs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TwQXCBZy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TwQXCBZy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7EE7C19421; Sun, 1 Mar 2026 01:43:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1772329435; bh=2qqGh2OE1JNTiMshtbDgeDg4zT3BE7VTeDI+ucEI6DQ=; h=From:To:Cc:Subject:Date:From; b=TwQXCBZy8vHQUVxsnhHlz0omYDZw5TRWo+lk0SoHH61MK6cWIUS2lVj7dBUuradg/ J/PUkC9IVVVcsswt1eltE6ZrWtf1yBXZYs9EHFtZGptfGFZKU/Vy4X9H+5Y6oWhtuv zfMtWhHYbxqE4T3U/rKiKFVsMdTvIOzAVMSCPtkYaDE1SvuwkGtYAGdk1bBw2K8hdr 1b4pmtj7mBFdxNL2hxxhDdz8givMrQoXZOUs+gP9TPyiyFAszCcnMLX/Lee/6IjUah yLsA8m8lzbFPpswNXn62GeDC04SyqsGUpgXZvVGE8+yF8npfi5BdE/n2X3MK3I+lIJ j26VzwZCyNaJg== From: Sasha Levin To: stable@vger.kernel.org, ailiop@suse.com Cc: NeilBrown , Chuck Lever , linux-nfs@vger.kernel.org Subject: FAILED: Patch "nfsd: fix return error code for nfsd_map_name_to_[ug]id" failed to apply to 6.1-stable tree Date: Sat, 28 Feb 2026 20:43:53 -0500 Message-ID: <20260301014353.1705991-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Patchwork-Hint: ignore X-stable: review Content-Transfer-Encoding: 8bit The patch below does not apply to the 6.1-stable tree. If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to . Thanks, Sasha ------------------ original commit in Linus's tree ------------------ >From 404d779466646bf1461f2090ff137e99acaecf42 Mon Sep 17 00:00:00 2001 From: Anthony Iliopoulos Date: Mon, 22 Dec 2025 14:30:05 -0500 Subject: [PATCH] nfsd: fix return error code for nfsd_map_name_to_[ug]id 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 Reviewed-by: NeilBrown Signed-off-by: Chuck Lever --- fs/nfsd/nfs4idmap.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fs/nfsd/nfs4idmap.c b/fs/nfsd/nfs4idmap.c index b5b3d45979c9b..c319c31b0f647 100644 --- a/fs/nfsd/nfs4idmap.c +++ b/fs/nfsd/nfs4idmap.c @@ -672,6 +672,8 @@ __be32 nfsd_map_name_to_uid(struct svc_rqst *rqstp, const char *name, return nfserr_inval; status = do_name_to_id(rqstp, IDMAP_TYPE_USER, name, namelen, &id); + if (status) + return status; *uid = make_kuid(nfsd_user_namespace(rqstp), id); if (!uid_valid(*uid)) status = nfserr_badowner; @@ -707,6 +709,8 @@ __be32 nfsd_map_name_to_gid(struct svc_rqst *rqstp, const char *name, return nfserr_inval; status = do_name_to_id(rqstp, IDMAP_TYPE_GROUP, name, namelen, &id); + if (status) + return status; *gid = make_kgid(nfsd_user_namespace(rqstp), id); if (!gid_valid(*gid)) status = nfserr_badowner; -- 2.51.0