All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dominik Maier <dmnk@google.com>
To: Chuck Lever <cel@kernel.org>, Jeff Layton <jlayton@kernel.org>
Cc: NeilBrown <neil@brown.name>,
	Olga Kornievskaia <okorniev@redhat.com>,
	Dai Ngo <Dai.Ngo@oracle.com>,  Tom Talpey <tom@talpey.com>,
	linux-nfs@vger.kernel.org, dmnk+artist@google.com
Subject: [PATCH v3 1/2] nfsd: return GDD4_UNAVAIL on nfserr_acces in nfsd4_get_dir_delegation()
Date: Mon, 30 Nov 2026 17:04:18 +0100	[thread overview]
Message-ID: <20261130160419.2644777-2-dmnk@google.com> (raw)
In-Reply-To: <20261130160419.2644777-1-dmnk@google.com>

Failing a directory delegation request with access denied aborts the
entire NFSv4 COMPOUND and breaks client stat() on search-only (mode
0711) directories.

The Linux NFS client places GET_DIR_DELEGATION before GETATTR in one
COMPOUND and does not expect NFS4ERR_ACCESS from the delegation step.

Reply NFS4_OK with GDD4_UNAVAIL on nfserr_acces so the delegation is
declined and the trailing GETATTR still runs, while returning other
errors such as non-directory or stale filehandles directly.

Fixes: 8b99f6a8c116 ("nfsd: wire up GET_DIR_DELEGATION handling")
Cc: stable@vger.kernel.org
Suggested-by: Chuck Lever <cel@kernel.org>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Dominik Maier <dmnk@google.com>
---
 fs/nfsd/nfs4proc.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c
index bb149a3e9aa4..28e61832331d 100644
--- a/fs/nfsd/nfs4proc.c
+++ b/fs/nfsd/nfs4proc.c
@@ -2934,6 +2934,10 @@ nfsd4_get_dir_delegation(struct svc_rqst *rqstp,
 	__be32 status;
 
 	status = nfsd_file_acquire_dir(rqstp, &cstate->current_fh, &nf);
+	if (status == nfserr_acces) {
+		gdd->gddrnf_status = GDD4_UNAVAIL;
+		return nfs_ok;
+	}
 	if (status != nfs_ok)
 		return status;
 
-- 
2.56.1.911.g883d8bcb20-goog


  reply	other threads:[~2026-11-30 16:04 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-30 16:04 [PATCH v3 0/2] nfsd: enforce search permission on directory delegations Dominik Maier
2026-11-30 16:04 ` Dominik Maier [this message]
2026-11-30 18:48   ` [PATCH v3 1/2] nfsd: return GDD4_UNAVAIL on nfserr_acces in nfsd4_get_dir_delegation() Chuck Lever
2026-11-30 16:04 ` [PATCH v3 2/2] nfsd: require NFSD_MAY_EXEC when acquiring directory delegations Dominik Maier
2026-11-30 18:48   ` Chuck Lever

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261130160419.2644777-2-dmnk@google.com \
    --to=dmnk@google.com \
    --cc=Dai.Ngo@oracle.com \
    --cc=cel@kernel.org \
    --cc=dmnk+artist@google.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=neil@brown.name \
    --cc=okorniev@redhat.com \
    --cc=tom@talpey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.