Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp10284760rwl; Sun, 1 Jan 2023 23:01:29 -0800 (PST) X-Google-Smtp-Source: AMrXdXubtI2CxRuio1OvhasIKR6yhBWwKmhp0niBZqXxM+SEGl/5sOkX6Af/+s3EvKRPhdfyjdSq X-Received: by 2002:a17:903:186:b0:188:d2b3:26c1 with SMTP id z6-20020a170903018600b00188d2b326c1mr55272053plg.10.1672642889345; Sun, 01 Jan 2023 23:01:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672642889; cv=none; d=google.com; s=arc-20160816; b=blru9ZmDrfSx7bI9Qe+U7k8EBxc4vR1OZxl+EzsUFb0h2Llqu7XrHYmKieJOXfe5YV RMDRV/+r0y3cGDaRXP/V3JtZIyTum6g+ckny/fEGFMQkJPC8X9jFQoxCiEoyZt4XFqrp SJAB3FMtozZYIuRhr8uRbmVJRF6nxQV/FZNECujQXlMfCpprfHkfPo2xW+t+3FRTvexI nzAUuSUivK2usseXm4ehBmDL32gFDlyKdR9VdiMoWyWVeYaAGKzOkfrSgdY4B4XjBZbQ wjw+TE3okFCGG2Q+cF8eA25hn/vR1zQfAKorORRaVDu7uiI4h8oDR3djo7SB9+abiDAI 6n8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:feedback-id:dkim-signature:dkim-signature; bh=HChj3M5D7hFhezttfYi9PTpBXUU8QQVqULTPd4dneco=; b=SOD+wTUUksv0gqF3+paMFKjNDLwFx7l2AAhy0gHSfMxZzR/xQuILMBtN54H65L11bx z5tblyrHVN8vN16sWlXdjHE5cRXeAZpn7CUC96Fojepleb/0ZnyMU7dWD5DKztoRK0Oa dnjdltq1MT5TNv/RkYpNcnQGCbVFhl0ka/gCC4oaE9AjIt76aozGxn3UKCp2iIjBEBZW u9Pdy/dsqlHNNWj9s2C3lLaotMFCaoez+6JYpcIu7kTCQFkWzYGZ1Xh6cpSyrmu2TJZa 3s1q/OgOvc9zVjS3Cs+JiI0UkmnyyfWdzw0kus9iM7v60Uht4BGsaR8/ff4D78zO92yU sT1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@themaw.net header.s=fm1 header.b=1f1RabKR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=AmOrdJfN; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n9-20020a170902d2c900b001836e51050esi31345123plc.572.2023.01.01.23.01.13; Sun, 01 Jan 2023 23:01:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@themaw.net header.s=fm1 header.b=1f1RabKR; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=AmOrdJfN; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229460AbjABG5u (ORCPT + 99 others); Mon, 2 Jan 2023 01:57:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229608AbjABG5t (ORCPT ); Mon, 2 Jan 2023 01:57:49 -0500 Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9536710BD for ; Sun, 1 Jan 2023 22:57:48 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailout.nyi.internal (Postfix) with ESMTP id 0D5CF5C0160; Mon, 2 Jan 2023 01:57:48 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 02 Jan 2023 01:57:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=themaw.net; h=cc :cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1672642668; x= 1672729068; bh=HChj3M5D7hFhezttfYi9PTpBXUU8QQVqULTPd4dneco=; b=1 f1RabKR1tCF4AIZPNa3yAIO85v2obKagly7Umh0+tbZCrSe1TwcLq76HRG1PsBr+ eX+FpfLDBL+DBzhQl7eKtTekulOFeElx7FLXZylgkL0T0BFXG7MZlADu0dfZrMGf cj5EgsUVjJ/uhhgMMnXplKKaHq5S+VccVec/v+V9EjahfEIk/6UZqA6EFj2OavIZ CTsU4i3OK6YMX+hIP9FCLkzk5LKTMDBA7A068Y05eBUO86yGXWIy3EPGkSiiX3QI UQloouulBnEhuX7wakfmu4tLtP8894eEPQJRhO0r1W8HegmC1vXKmSKk+fkRaxkz 55ZDRsHtaKqQgUmzCYV+Q== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1672642668; x= 1672729068; bh=HChj3M5D7hFhezttfYi9PTpBXUU8QQVqULTPd4dneco=; b=A mOrdJfNRWAiDRJc27qxXZOnySHJrXxtoJTAhypvkw5RZpTtBemE4Nrzr8I5A5MlR lbixwJBub1dhHyMxaKciy7Q/RtyRA9uv+34+u/Tfap4/aIEiPWrXVNF+VmqIkvIA bGEJs2M93xGlc7Jq98/iMi0j+Y1mop2QvXWs+EOEJroST8MU3KatGHMy75CUNATJ sOAEbtqTfEBU7XKEHac+f9516xfCJvE/LyabV6qeJNZLhPobZmPHiTsJx5R3T0f0 6RpCchDmkyYyOPlShhE52DkY/pWqdLOGdm/s9fTVOVUXip+QjckrDojTgybh8kPg mW17kBWfE2ajqrTFN+FVg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrjedugddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffhvfevfhgjtgfgsehtjeertddtfeejnecuhfhrohhmpefkrghn ucfmvghnthcuoehrrghvvghnsehthhgvmhgrfidrnhgvtheqnecuggftrfgrthhtvghrnh epjeehvdetgeejteeuleeigeefieduudfgteelgefggeetvdefveethfdtjeevledtnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhgrvhgvnh esthhhvghmrgifrdhnvght X-ME-Proxy: Feedback-ID: i31e841b0:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 2 Jan 2023 01:57:45 -0500 (EST) Message-ID: Date: Mon, 2 Jan 2023 14:57:43 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] nfsd: fix handling of readdir in v4root vs. mount upcall timeout Content-Language: en-US From: Ian Kent To: Chuck Lever III , Jeff Layton Cc: Linux NFS Mailing List , Steve Dickson , JianHong Yin , Richard Weinberger References: <20221213180826.216690-1-jlayton@kernel.org> <0918676C-124C-417F-B8DE-DA1946EE91CC@oracle.com> <988799bd54c391259cfeff002660a4002adb96d2.camel@kernel.org> <81f891ef-b498-24b0-12e3-4ddda8062dc0@themaw.net> <0d6deecbe0dff95ebbe061914ddb00ca04d1f3c1.camel@kernel.org> <940934D4-7896-4C0D-93F1-26170C49CBE4@oracle.com> <77ed2f3a-0fbb-ddec-6c93-2a7ea44f5f9f@themaw.net> In-Reply-To: <77ed2f3a-0fbb-ddec-6c93-2a7ea44f5f9f@themaw.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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 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 >>>>>>>> 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