Linux NFS development
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Jeff Layton <jlayton@kernel.org>,
	Richard Weinberger <richard@nod.at>,
	linux-nfs@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org,
	chuck.lever@oracle.com, anna@kernel.org,
	trond.myklebust@hammerspace.com, viro@zeniv.linux.org.uk,
	chris.chilvers@appsbroker.com, david.young@appsbroker.com,
	luis.turcitu@appsbroker.com, david@sigma-star.at
Subject: Re: [PATCH 2/3] fs: namei: Allow follow_down() to uncover auto mounts
Date: Fri, 18 Nov 2022 07:37:30 +0800	[thread overview]
Message-ID: <459307a8-cb64-265e-7112-feafaec6a32f@themaw.net> (raw)
In-Reply-To: <f31d4114f363ed9de0eba66ad6a730fe013896a6.camel@kernel.org>


On 18/11/22 05:01, Jeff Layton wrote:
> On Thu, 2022-11-17 at 20:11 +0100, Richard Weinberger wrote:
>> This function is only used by NFSD to cross mount points.
>> If a mount point is of type auto mount, follow_down() will
>> not uncover it. Add LOOKUP_AUTOMOUNT to the lookup flags
>> to have ->d_automount() called when NFSD walks down the
>> mount tree.
>>
>> Signed-off-by: Richard Weinberger <richard@nod.at>
>> ---
>>   fs/namei.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/fs/namei.c b/fs/namei.c
>> index 578c2110df02..000c4b84e6be 100644
>> --- a/fs/namei.c
>> +++ b/fs/namei.c
>> @@ -1462,7 +1462,7 @@ int follow_down(struct path *path)
>>   {
>>   	struct vfsmount *mnt = path->mnt;
>>   	bool jumped;
>> -	int ret = traverse_mounts(path, &jumped, NULL, 0);
>> +	int ret = traverse_mounts(path, &jumped, NULL, LOOKUP_AUTOMOUNT);
>>   
>>   	if (path->mnt != mnt)
>>   		mntput(mnt);
>
> What happens when CROSSMOUNT isn't enabled and someone tries to stroll
> into an automount point? I'm guessing the automount happens but the
> export is denied? It seems like LOOKUP_AUTOMOUNT ought to be conditional
> on the parent export having CROSSMOUNT set.
>
> There's also another caller of follow_down too, the UNIX98 pty code.
> This may be harmless for it, but it'd be best not to perturb that if we
> can help it.
>
> Maybe follow_down can grow a lookupflags argument?es, I think that's needed too.


Changing the core VFS unconditionally ricks breaking things.


For example this:

         if (!(lookup_flags & (LOOKUP_PARENT | LOOKUP_DIRECTORY |
                            LOOKUP_OPEN | LOOKUP_CREATE | 
LOOKUP_AUTOMOUNT)) &&
             dentry->d_inode)

will never be true now so that, at the least, the handling of this case

will change for automount(8). I don't remember now the reasons behind

doing this but I do remember there was a special case that needed to

be handled by it.


Ian


  parent reply	other threads:[~2022-11-17 23:37 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 ` [PATCH 1/3] NFSD: Teach nfsd_mountpoint() auto mounts Richard Weinberger
2022-11-17 19:11 ` [PATCH 2/3] fs: namei: Allow follow_down() to uncover " 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 [this message]
2022-11-17 19:11 ` [PATCH 3/3] NFS: nfs_encode_fh: Remove S_AUTOMOUNT check Richard Weinberger
  -- strict thread matches above, loose matches on Subject: below --
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 2/3] fs: namei: Allow follow_down() to uncover 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=459307a8-cb64-265e-7112-feafaec6a32f@themaw.net \
    --to=raven@themaw.net \
    --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=richard@nod.at \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox