Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp645578rwe; Fri, 14 Apr 2023 07:59:39 -0700 (PDT) X-Google-Smtp-Source: AKy350aZBtYLWUU/MZZ7ET/T+9/pr9qO1zPBCYKHSG2wq2Od0lq+oGGf0tf4GBFd/yOu5eN/BRNf X-Received: by 2002:a17:902:d481:b0:1a2:8940:6da4 with SMTP id c1-20020a170902d48100b001a289406da4mr3551026plg.29.1681484379025; Fri, 14 Apr 2023 07:59:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681484379; cv=none; d=google.com; s=arc-20160816; b=0zS2zVczixsODaldnEaaHYjF97+IZ2en14A4yU42Q+5t6dmycLd/KkVfFGdSlEHI0q LseM0kpU7wrc7QgnFnesG+yqf1CNg/kAZE1PhN0mP38tbi+x9JdAuqeeu2OxyFOeaAcf FP+o0LZ9XlizxzWDJb7yRa4lTyCVtfehmt7XKl/WyARRd5slt40sYR0Gdh4jfHHEpIhH AM0bM7QC1rbgtRsl9joGuCDvDECtvIerfSs1pMdTBIqSuwlnhbZAKA0w+rlNjnPGKECv XMt5CvsWfK6LcLBQT2NzUuT8z9KML/Khs4bHYB1J9nIrrJcMEEAc2Z+iLJLCopT7RlDD 4HnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=V5bF/giLnmiuSWUUww4zKnjupwvTlof72GkeF0z3SVk=; b=GOUHiqy4rTaaTKdYiGBalaGV5JWH81qsv4M3b4YuMInQbGfoCgQYC+iHuXT/IL4P77 lNrlmVK+zUdV9hw29QQoaG3WuL0v/pCTSM3Zz5I0qwwLmo3yLImo4+5391Vsm1v6U0NC iLGZgrjo/td6dAHF+1QaC4xuBTj14P8GpiAdrw8vvmjHqf4fJaIwg0ocgY+uGWvYCJjp CJEO/hxEgZ88RUMcRhi37Y0cHr2l5GzjliwVgn5Voyb3t/kwHB1YMHJsnEGJ+1YAUWiR Ps0a8/E4mcUCPOKaOsiuGPYM2QDp1rUcOCvpkukAJRzP+MKY4bPuj54YZW/mNyUUnevb 5VVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=NokI3OdX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a63f946000000b0051b856ffbbbsi1477pgk.294.2023.04.14.07.59.17; Fri, 14 Apr 2023 07:59:39 -0700 (PDT) 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=@linux.org.uk header.s=zeniv-20220401 header.b=NokI3OdX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230185AbjDNO6U (ORCPT + 99 others); Fri, 14 Apr 2023 10:58:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230255AbjDNO6T (ORCPT ); Fri, 14 Apr 2023 10:58:19 -0400 Received: from zeniv.linux.org.uk (zeniv.linux.org.uk [IPv6:2a03:a000:7:0:5054:ff:fe1c:15ff]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D37DDC654; Fri, 14 Apr 2023 07:58:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=linux.org.uk; s=zeniv-20220401; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=V5bF/giLnmiuSWUUww4zKnjupwvTlof72GkeF0z3SVk=; b=NokI3OdXLvkpvpwCRmy8q7lGCI y4waF4+isNFsvbOvQRRL0Y5GmMZPrglod3TVl5pxGutBUhhDpmbahwmnJeZSquZlnrei977fNpQzq 3j9pIM40yOUXtIOMcRnfS+jd7kVnD1GvJPxOg/NdTZfjs7aRnZoV1BntP9DO3COxKFG4nXhJQn790 WxIrKxsGZ2FSJxzkxoANQpParXBVpbvAuAgFb32iSXfcnhhveH0CIddgXZiSPQABQOkYa16KintWz ZMVkSMa83sYvn+dS12r+ZIqeNE/x0NyL9FRn+KuelxIQm7AX58rqORksQS6R6iL5hxfQhe3Wd4qgA LFv75VKA==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1pnKsB-0090JN-19; Fri, 14 Apr 2023 14:57:59 +0000 Date: Fri, 14 Apr 2023 15:57:59 +0100 From: Al Viro To: Jeff Layton Cc: Christian Brauner , Dave Wysochanski , linux-fsdevel , linux-nfs , David Howells , NeilBrown , Christoph Hellwig Subject: Re: allowing for a completely cached umount(2) pathwalk Message-ID: <20230414145759.GJ3390869@ZenIV> References: <95ee689c76bf034fa2fe9fade0bccdb311f3a04f.camel@kernel.org> <20230414023211.GE3390869@ZenIV> <8d2c619d2a91f3ac925fbc8e4fc467c6b137ab14.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <8d2c619d2a91f3ac925fbc8e4fc467c6b137ab14.camel@kernel.org> Sender: Al Viro X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 Fri, Apr 14, 2023 at 06:01:59AM -0400, Jeff Layton wrote: > On Fri, 2023-04-14 at 03:32 +0100, Al Viro wrote: > > On Thu, Apr 13, 2023 at 06:00:42PM -0400, Jeff Layton wrote: > > > > > It describes a situation where there are nested NFS mounts on a client, > > > and one of the intermediate mounts ends up being unexported from the > > > server. In a situation like this, we end up being unable to pathwalk > > > down to the child mount of these unreachable dentries and can't unmount > > > anything, even as root. > > > > So umount -l the stuck sucker. What's the problem with that? > > > > You mean lazy umount the parent that is stuck? What happens to the child > mount in that case? Is it also eventually cleaned up? Yes. Lazy umount takes out the contributions to refcount due to being present in mount tree; as soon as other references go away (opened files, current directories, in-progress syscalls on files in there) struct mount instance releases the active reference to filesystem instance (struct super_block) and goes away. Once all active references to filesystem instance are gone, it gets shut down. > Yeah, I hadn't considered symlinks here. Still, if we have a cached > symlink dentry, wouldn't we also already have the symlink target in > cache too? Or is that not guaranteed? Not at all. What's more, why would we have that symlink dentry cached in the first place? If you suddenly impose that kind of restrictions on umount(2), you are pretty much guaranteed to break userland... Symlink dentries are rarely pinned, BTW - they may very well be cached if we hit them often enough, but outside of the things like lchown()/lstat() or pathname resolution in progress that is currently traversing that symlink... refcount is going to be zero.