All of lore.kernel.org
 help / color / mirror / Atom feed
From: Richard Weinberger <richard@nod.at>
To: linux-nfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	jlayton@kernel.org, chuck.lever@oracle.com, anna@kernel.org,
	trond.myklebust@hammerspace.com, viro@zeniv.linux.org.uk,
	raven@themaw.net, chris.chilvers@appsbroker.com,
	david.young@appsbroker.com, luis.turcitu@appsbroker.com,
	david@sigma-star.at, Richard Weinberger <richard@nod.at>
Subject: [PATCH 1/3] NFSD: Teach nfsd_mountpoint() auto mounts
Date: Thu, 17 Nov 2022 20:11:49 +0100	[thread overview]
Message-ID: <20221117191151.14262-2-richard@nod.at> (raw)
In-Reply-To: <20221117191151.14262-1-richard@nod.at>

Currently nfsd_mountpoint() tests for mount points using d_mountpoint(),
this works only when a mount point is already uncovered.
In our case the mount point is of type auto mount and can be coverted.
i.e. ->d_automount() was not called.

Using d_managed() nfsd_mountpoint() can test whether a mount point is
either already uncovered or can be uncovered later.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 fs/nfsd/vfs.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c
index f650afedd67f..157f0df0e93a 100644
--- a/fs/nfsd/vfs.c
+++ b/fs/nfsd/vfs.c
@@ -160,7 +160,7 @@ int nfsd_mountpoint(struct dentry *dentry, struct svc_export *exp)
 		return 1;
 	if (nfsd4_is_junction(dentry))
 		return 1;
-	if (d_mountpoint(dentry))
+	if (d_managed(dentry))
 		/*
 		 * Might only be a mountpoint in a different namespace,
 		 * but we need to check.
-- 
2.26.2


  reply	other threads:[~2022-11-17 19:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17 19:11 [PATCH 0/3] NFS: NFSD: Allow crossing mounts when re-exporting Richard Weinberger
2022-11-17 19:11 ` Richard Weinberger [this message]
2022-11-17 19:11 ` [PATCH 2/3] fs: namei: Allow follow_down() to uncover auto mounts Richard Weinberger
2022-11-17 21:01   ` Jeff Layton
2022-11-17 21:12     ` Richard Weinberger
2022-11-17 21:42       ` Jeff Layton
2022-11-27 21:29         ` Richard Weinberger
2022-11-28 11:49           ` Jeff Layton
2022-11-17 23:37     ` Ian Kent
2022-11-17 19:11 ` [PATCH 3/3] NFS: nfs_encode_fh: Remove S_AUTOMOUNT check Richard Weinberger
2022-12-07  8:43 [PATCH 0/3 v2] NFS: NFSD: Allow crossing mounts when re-exporting Richard Weinberger
2022-12-07  8:43 ` [PATCH 1/3] NFSD: Teach nfsd_mountpoint() auto mounts Richard Weinberger

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=20221117191151.14262-2-richard@nod.at \
    --to=richard@nod.at \
    --cc=anna@kernel.org \
    --cc=chris.chilvers@appsbroker.com \
    --cc=chuck.lever@oracle.com \
    --cc=david.young@appsbroker.com \
    --cc=david@sigma-star.at \
    --cc=jlayton@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=luis.turcitu@appsbroker.com \
    --cc=raven@themaw.net \
    --cc=trond.myklebust@hammerspace.com \
    --cc=viro@zeniv.linux.org.uk \
    /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.