Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp297287rwe; Fri, 14 Apr 2023 03:02:45 -0700 (PDT) X-Google-Smtp-Source: AKy350ZDPtd2T5cFbvFjt5rB05DOkbiEzpDj/vOKH70XM0L0tI27bA1T0MsbJ6KwlJpmLrZxKwqO X-Received: by 2002:a05:6a20:3b1a:b0:eb:79d1:cd7d with SMTP id c26-20020a056a203b1a00b000eb79d1cd7dmr4698151pzh.17.1681466565756; Fri, 14 Apr 2023 03:02:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681466565; cv=none; d=google.com; s=arc-20160816; b=GpfnSq0b2ODrgXNWWXUiZGkSbSLI3TrG8tOL46Lajx3kXwSLJZ6kNLWfHOj6LLfXE5 efXrDTM7MW9xRVDf9ImByLokN54TuCEG9RFmkiSZPk4klu1yK0uTK/jV1FQ06PKJv7Oq aQqTctsHBMAGBcDx4WViE8ApZYkBibfujsFOkgQpSvdgBvYddd7hFWoGxyZOmTqyaK/S +dxvO9ZXAoia98+s24CHVTnKMMa6JdV6PsdNTSmyU8eAnF+/ob37p3xWOnErf4KIaSkC HWirsMRzs2dm5e4R3cDJUehj3RPFkVTv31bfZ4dfiHRNHM+y3EiSy6B4A3v4T2D/XjSI rOfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=VrSSSBPO0RjIy5iE8J9aoZCguf+xzb+X/4beDeX1hzw=; b=CVK+QAtmAHIfZiPQiLafGWI86Wiz20a51d1LRi+9FGO/9hiCwBAFMeGskJzF3P5oq7 HlTX+2UjGnW+IPTU7QpmJRVcl4E4dvCc1wHSuC4PTl4vXAW0K9tLptS2HlKzrpMHMZ5R V030/G7RCsxMUpKgGCL+fJ356DHzdzxl2yYmDExX7d/6RDKn00mlJou52Mwq9hBfIzXq gjYMNuDntCo6zcd52IpxV54rGYJxXmbP5J5Hs5+uNXXfjOaWe9B4/+/LBT72o8HdDVG7 mabGT4Vl5fWGjVfnQvqH3RxdAyleeO1p+E2Whtm6WmbDrnpMyN6IlpphVkMkZYd8mPJy Cw7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AXmN+IFf; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s1-20020a63dc01000000b00517a4a75525si3528762pgg.884.2023.04.14.03.02.28; Fri, 14 Apr 2023 03:02:45 -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=@kernel.org header.s=k20201202 header.b=AXmN+IFf; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229611AbjDNKCE (ORCPT + 99 others); Fri, 14 Apr 2023 06:02:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjDNKCD (ORCPT ); Fri, 14 Apr 2023 06:02:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBF3E76B4; Fri, 14 Apr 2023 03:02:02 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 82B0B645FF; Fri, 14 Apr 2023 10:02:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 00FEFC433D2; Fri, 14 Apr 2023 10:02:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681466521; bh=Po//8bQ/Ud+UwSwJ0EqALVbU8j/ZFbLNuOKXcDcPfdw=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=AXmN+IFfWPL1qt4B913nrLJyterbuNFqpe023OtZ3Au63xFm+i5zAwDbwTjTSJ0wW Nb5sac80ET/87acJrH5oqXSdMIF55R94YjKWL8S5K2xPbV7vu7e39mP7O8WvSnJYub QjD8+LASf1zaLPZ/mPiTNZff7kxVkGdC1UyH3MWzv612a4rO/+Od6kzjdwnt74otdO 7W1s++0zueHmnxMocVw05RKgifW+Jkn3tGR7EHW4RDnewqPwhzVfGIWcbx+iWjzuLv 8vOjOI8RNyTW+RNMk3Vq0H3WQtJ9NNLmth6zQ1EWg3rJPfOpsKhfukd1AU1WpY+XWM c3ep4mxBPzzDQ== Message-ID: <8d2c619d2a91f3ac925fbc8e4fc467c6b137ab14.camel@kernel.org> Subject: Re: allowing for a completely cached umount(2) pathwalk From: Jeff Layton To: Al Viro Cc: Christian Brauner , Dave Wysochanski , linux-fsdevel , linux-nfs , David Howells , NeilBrown , Christoph Hellwig Date: Fri, 14 Apr 2023 06:01:59 -0400 In-Reply-To: <20230414023211.GE3390869@ZenIV> References: <95ee689c76bf034fa2fe9fade0bccdb311f3a04f.camel@kernel.org> <20230414023211.GE3390869@ZenIV> Content-Type: text/plain; charset="ISO-8859-15" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.4 (3.46.4-1.fc37) MIME-Version: 1.0 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,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, 2023-04-14 at 03:32 +0100, Al Viro wrote: > On Thu, Apr 13, 2023 at 06:00:42PM -0400, Jeff Layton wrote: >=20 > > 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. >=20 > So umount -l the stuck sucker. What's the problem with that? >=20 You mean lazy umount the parent that is stuck? What happens to the child mount in that case? Is it also eventually cleaned up? > > 2/ disallow ->lookup operations: a umount is about removing an existing > > mount, so the dentries had better already be there. >=20 > That changes the semantics; as it is, you need exec permissions on the > entire path... >=20 Yep. But, I think it makes some sense to do so in the context of a umount. Mostly, umount is done by a privileged user anyway so avoiding permission checks isn't too great a stretch, IMO. > > Is this a terrible idea? Are there potentially problems with > > containerized setups if we were to do something like this? Are there > > better ways to solve this problem (and others like it)? Maybe this woul= d > > be best done with a new UMOUNT_CACHED flag for umount2()? >=20 > We already have lazy umount. And what will you do to symlinks you run > into along the way? They *are* traversed; requiring the caller to > canonicalize them will only shift the problem to userland... 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? --=20 Jeff Layton