All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Kent <raven@themaw.net>
To: Chuck Lever III <chuck.lever@oracle.com>,
	Jeff Layton <jlayton@kernel.org>
Cc: Linux NFS Mailing List <linux-nfs@vger.kernel.org>,
	Steve Dickson <steved@redhat.com>,
	JianHong Yin <yin-jianhong@163.com>,
	Richard Weinberger <richard@nod.at>
Subject: Re: [PATCH] nfsd: fix handling of readdir in v4root vs. mount upcall timeout
Date: Mon, 2 Jan 2023 14:57:43 +0800	[thread overview]
Message-ID: <e1d693e3-0627-7ec3-6f76-10c06075d278@themaw.net> (raw)
In-Reply-To: <77ed2f3a-0fbb-ddec-6c93-2a7ea44f5f9f@themaw.net>


On 2/1/23 14:34, Ian Kent wrote:
>
> On 2/1/23 02:09, Chuck Lever III wrote:
>>
>>> On Dec 14, 2022, at 12:37 AM, Ian Kent <raven@themaw.net> wrote:
>>>
>>> On 14/12/22 08:39, Jeff Layton wrote:
>>>> On Wed, 2022-12-14 at 07:14 +0800, Ian Kent wrote:
>>>>> On 14/12/22 04:02, Jeff Layton wrote:
>>>>>> On Tue, 2022-12-13 at 19:00 +0000, Chuck Lever III wrote:
>>>>>>>> On Dec 13, 2022, at 1:08 PM, Jeff Layton <jlayton@kernel.org> 
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>> If v4 READDIR operation hits a mountpoint and gets back an error,
>>>>>>>> then it will include that entry in the reply and set 
>>>>>>>> RDATTR_ERROR for it
>>>>>>>> to the error.
>>>>>>>>
>>>>>>>> That's fine for "normal" exported filesystems, but on the 
>>>>>>>> v4root, we
>>>>>>>> need to be more careful to only expose the existence of 
>>>>>>>> dentries that
>>>>>>>> lead to exports.
>>>>>>>>
>>>>>>>> If the mountd upcall times out while checking to see whether a
>>>>>>>> mountpoint on the v4root is exported, then we have no recourse 
>>>>>>>> other
>>>>>>>> than to fail the whole operation.
>>>>>>> Thank you for chasing this down!
>>>>>>>
>>>>>>> Failing the whole READDIR when mountd times out might be a bad 
>>>>>>> idea.
>>>>>>> If the mountd upcall times out every time, the client can't make
>>>>>>> any progress and will continue to emit the failing READDIR request.
>>>>>>>
>>>>>>> Would it be better to skip the unresolvable entry instead and let
>>>>>>> the READDIR succeed without that entry?
>>>>>>>
>>>>>> Mounting doesn't usually require working READDIR. In that 
>>>>>> situation, a
>>>>>> readdir() might hang (until the client kills), but a lookup of other
>>>>>> dentries that aren't perpetually stalled should be ok in this 
>>>>>> situation.
>>>>>>
>>>>>> If mountd is that hosed then I think it's unlikely that any progress
>>>>>> will be possible anyway.
>>>>> The READDIR shouldn't trigger a mount yes, but if it's a valid 
>>>>> automount
>>>>>
>>>>> point (basically a valid dentry in this case I think) it should be 
>>>>> listed.
>>>>>
>>>>> It certainly shouldn't hold up the READDIR, passing into it is when a
>>>>>
>>>>> mount should occur.
>>>>>
>>>>>
>>>>> That's usually the behavior we want for automounts, we don't want 
>>>>> mount
>>>>>
>>>>> storms on directories full of automount points.
>>>>>
>>>> We only want to display it if it's a valid _exported_ mountpoint.
>>>>
>>>> The idea here is to only reveal the parts of the namespace that are
>>>> exported in the nfsv4 pseudoroot. The "normal" contents are not 
>>>> shown --
>>>> only exported mountpoints and ancestor directories of those 
>>>> mountpoints.
>>>>
>>>> We don't want mountd triggering automounts, in general. If the
>>>> underlying filesystem was exported, then it should also already be
>>>> mounted, since nfsd doesn't currently trigger automounts in
>>>> follow_down().
>>> Umm ... must they already be mounted?
>>>
>>>
>>> Can't it be a valid mount point either not yet mounted or timed out
>>>
>>> and umounted. In that case shouldn't it be listed, I know that's
>>>
>>> not the that good an outcome because its stat info will change when
>>>
>>> it gets walked into but it's usually the only sane choice.
>>>
>>>
>>>> There is also a separate patchset by Richard Weinberger to allow 
>>>> nfsd to
>>>> trigger automounts if the parent filesystem is exported with -o
>>>> crossmnt. That should be ok with this patch, since the automount 
>>>> will be
>>>> triggered before the upcall to mountd. That should ensure that it's
>>>> already mounted by the time we get to upcalling for its export.
>>> Yep, saw that, ;)
>> I'm not sure if there is consensus on this patch.
>>
>> It's been pushed to nfsd's for-rc branch for wider testing, but if
>> there's a strong objection I can pull it out before the next -rc PR.
>
>
> I don't have any objections, my original comment about it breaking
>
> existing behavior has been addressed.


Actually I'm confused with the other patch series Jeff mentioned.

I still don't have any objections, ;)


I was a little curious about the error handling but that's

because my memories of the jukebox error handling on the client

side are different to what's being done but here it's the server

so it makes sense to assume the client will do the work and retry

or whatever.


Ian


  reply	other threads:[~2023-01-02  6:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-13 18:08 [PATCH] nfsd: fix handling of readdir in v4root vs. mount upcall timeout Jeff Layton
2022-12-13 19:00 ` Chuck Lever III
2022-12-13 20:02   ` Jeff Layton
2022-12-13 23:14     ` Ian Kent
2022-12-14  0:39       ` Jeff Layton
2022-12-14  5:37         ` Ian Kent
2023-01-01 18:09           ` Chuck Lever III
2023-01-01 18:18             ` Chuck Lever III
2023-01-03 13:31               ` Jeff Layton
2023-01-02  6:34             ` Ian Kent
2023-01-02  6:57               ` Ian Kent [this message]
2023-01-01 21:16           ` Jeff Layton
2023-01-02  6:41             ` Ian Kent

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=e1d693e3-0627-7ec3-6f76-10c06075d278@themaw.net \
    --to=raven@themaw.net \
    --cc=chuck.lever@oracle.com \
    --cc=jlayton@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=richard@nod.at \
    --cc=steved@redhat.com \
    --cc=yin-jianhong@163.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.