Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp8499lqh; Mon, 6 May 2024 09:36:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXox2OrMbrG1c94l5kTfpWnFL80andQZJp0pFvHA1/lka00Iu8LAdMA5PZX6FDqKRyQAO9ZZPn6HEZS1pdy19GwLxIRDqtEyRVpGpp3/Q== X-Google-Smtp-Source: AGHT+IHVqczciaxNSX4VdWqe3BegJAY9r2sj3KSBmz5ScdY6ZuPLl1CtA/wqRHNWCo0lJ/SqkXTq X-Received: by 2002:a05:620a:521f:b0:790:c81e:7840 with SMTP id dc31-20020a05620a521f00b00790c81e7840mr10637560qkb.12.1715013371641; Mon, 06 May 2024 09:36:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715013371; cv=pass; d=google.com; s=arc-20160816; b=QqtPgO2Vti9nImpO49ZHKZDzS+xJz866o4LohXKOwWJPCgGyEjq9ayT9r4BkQJ433V xCjfZR5PBrUKKGjxVHZYDqe5V3j/v2YsxJkA+IS3kGv2XMHO5dsKJxllv3rDtoVeZnIK sa0aAZwHLbi8i00F1rtRlgsO+rbves+G1tjGSZH0GcEBYR9/UbLWbURqTqMn6xvymcMo 7hhYso369P6KTzos0lzoicdClKU5ca4oxJcCjWYA4LvpF6pYJrhRyBSYS4rMLJ+kcofL 1IV0wCBoHW9sYBaADxjtynqdoUoFpRiEctOQy3xJlxZ6etc1jzuonQZ9JbECUZNZ8+a7 5BQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=C1+gDyAz2yuBcSP9o7MlLvz22C8E854DqvUWLMQn7W0=; fh=HzVLnJi8X0PTkh3BW9eWtTj8vN/0gVv1AW5X9gSuxbs=; b=f3iAc1hfFjoHc8XTTxngvRbjSqtzZnZQ0wimDfpytVGttzZ8vMyVP1XHry8+7rJ0lm ug1j9YsiUOSgc8Bn72LDdRvQvqHiDHL51JHOTAaEPTRUrSKkCinvdkM+j/oPwXk+Skkc h6vUwOB1uswI24kIP+5ig53atQRRHOeNKfLzoOj+3k2Tyt92QTh5Kc6uOXv+/LDrSpJD FQ9WQmebDioeGiWqZDv2LsIcax8ijLGW6L6lWOuwPFAujrjBLc+bcjUhaWHLFYZeNT5P obbOByRd2NJoJLHa+xExlw+hnQzZlhGAY1u82TEPgkvItru8FnNXV3YURjzyG4lRFMC7 uL1w==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HZ0N4Wo7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id h19-20020a05620a13f300b0079294bfa067si3348788qkl.58.2024.05.06.09.36.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 09:36:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs+bounces-3172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=HZ0N4Wo7; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-nfs+bounces-3172-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-nfs+bounces-3172-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 3C9BC1C20858 for ; Mon, 6 May 2024 16:36:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1F5297868B; Mon, 6 May 2024 16:36:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HZ0N4Wo7" X-Original-To: linux-nfs@vger.kernel.org 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 EE22342AA0 for ; Mon, 6 May 2024 16:36:08 +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=1715013369; cv=none; b=V51AFP6xsPiypHJcSS62ntDEo3VjkcynNtM2Q5ZfFJAcCsqFlx8LduZga5GQrQPRc7kMjb0FctGeOKq5osBVkgYEpaq4S37mri/RYfRWq3DgKj1Kw3GL+o9WYndTlNUM/Rxk87xu8eF6l6xMuY/aefhOuq0UtEwEpFuCPyJeN2M= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715013369; c=relaxed/simple; bh=4iFvIyqyy+Zk2ziHZSC2tI7nfrXhtwBKLlPyAf//K88=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=kuyWisLQ/ag0T9ZFV5A6cCX+tWVI/oBW15NDdRtpl9W2HLczpH+H+RMcBf6cgeH5Lkc4ajAWL+HbvUdT4QKrlaJrNJEIfZor5f8oyRAxCOG2DpXSqXg00XXQZU4VSX9QkS/j054eWPlGAoT7DlLPZEdCGwTg5Z+D6iWAfFWpWXA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HZ0N4Wo7; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 516D6C116B1; Mon, 6 May 2024 16:36:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715013368; bh=4iFvIyqyy+Zk2ziHZSC2tI7nfrXhtwBKLlPyAf//K88=; h=From:To:Cc:Subject:Date:From; b=HZ0N4Wo7SkbWCSVDhtwn+sWl/ozcV0fGOB548s4WXEX4l857aR135/NskoiTYDh7t dI+as4DraQU4C6a7H2lHHrGXjRpVwIKRlT1f9EyyqMHEuuhuydYG785WSqGLBjJYTN 0n10UlAghVGfZOlkuGn1xUDsEQpsp0BPVV4lv8OkIH6sOAn2flkGVrBIGbwCuzEtvx o6kAnRUjTrroZgbZBy61iuJ0+zAX+ZFay5Ji2BE4DKT4q/2Q99921C+tpjtDj/m0L2 l+5cx10TKY/PzGZwz+LcheObAy0o2/tINJ9o7vgkB0i9c0kNNogh0uNfU/EG6Nv7IX ceFCsN0QwBJNA== From: trondmy@kernel.org To: Chuck Lever Cc: linux-nfs@vger.kernel.org Subject: [PATCH 1/2] knfsd: LOOKUP can return an illegal error value Date: Mon, 6 May 2024 12:30:04 -0400 Message-ID: <20240506163005.9990-1-trondmy@kernel.org> X-Mailer: git-send-email 2.45.0 Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Trond Myklebust The 'NFS error' NFSERR_OPNOTSUPP is not described by any of the official NFS related RFCs, but appears to have snuck into some older .x files for NFSv2. Either way, it is not in RFC1094, RFC1813 or any of the NFSv4 RFCs, so should not be returned by the knfsd server, and particularly not by the "LOOKUP" operation. Instead, let's return NFSERR_STALE, which is more appropriate if the filesystem encodes the filehandle as FILEID_INVALID. Cc: stable@vger.kernel.org Signed-off-by: Trond Myklebust --- fs/nfsd/nfsfh.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c index dbfa0ac13564..d41e7630eb7a 100644 --- a/fs/nfsd/nfsfh.c +++ b/fs/nfsd/nfsfh.c @@ -572,7 +572,7 @@ fh_compose(struct svc_fh *fhp, struct svc_export *exp, struct dentry *dentry, _fh_update(fhp, exp, dentry); if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) { fh_put(fhp); - return nfserr_opnotsupp; + return nfserr_stale; } return 0; @@ -598,7 +598,7 @@ fh_update(struct svc_fh *fhp) _fh_update(fhp, fhp->fh_export, dentry); if (fhp->fh_handle.fh_fileid_type == FILEID_INVALID) - return nfserr_opnotsupp; + return nfserr_stale; return 0; out_bad: printk(KERN_ERR "fh_update: fh not verified!\n"); -- 2.45.0