Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp1008049rdg; Wed, 11 Oct 2023 11:28:02 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHjupVjKWjy+jt4WKPzYElR21uw9s6VhBjSXzM4AHULBgbBpQtmc4h28Et4ZTz+Ny7RKYNu X-Received: by 2002:a17:903:25c7:b0:1c9:cc88:502c with SMTP id jc7-20020a17090325c700b001c9cc88502cmr2436264plb.69.1697048881781; Wed, 11 Oct 2023 11:28:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697048881; cv=none; d=google.com; s=arc-20160816; b=eS2gPM7g7vJ3Yq+EcEJ5aK4rvmQr3LKKFpecvarLX2DoSMpSM8Fn9x7iMSsVG/3gwY eqHGQTdnwqeuUDopEjp9AGwEvVXfEBSxJ/RDEpZ+MTbslr1JzUkV1UjTieHLNQG5d5+c xDDm/tDhRoLlRrONyTrs/6iN4tAAK5ZRIzzp7ihO5qmeWcdlfJHLqOEOhJDup/6gvEe+ PkKCK3ar56IKMkO5lyDD5iQ4HNIxJ8DxkrvAOFe8/LWLoRi7/QsV7K9mA+4ohAwBtMAU wQ8WNuU5qe2QqVWuHxKnATMvddv1aQyogX1boV9HJcF0KRtvLPKJIot+PMXewb+kOb7Q Trtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=HfuTTDR+nJ6o/M0eow0TQoImOGAmMP0qEOP+RWPlF7Y=; fh=XCEN0sQ0vpSU+R70K7SsEOZGhA6b6HFENkpvm1Rt7l8=; b=kWcNhcVa2jPtNX8b+Zk8hpywpUS2PRQBiAUsoaP1GmxAYj4/BqEHvJLz90I5+HUAoU AMr/4mKmHW0vceTHLdvjRDNrBtFS8P2jFwiWBqqrK//ZKoPuSv7jAXbM4nDKNOFypNUy 7vfRec8GPkwwsDKRH70ErsIOVZUge8BvddztDHWfv9MPiiHZ/rkLg85iNIf8WeDUL38+ 7akfbGLqilMauHtTtShiH9O+CGFWaYEwJsPNiHMhwOV79ts+Zo1orV2Wk5par3WPtzUr 4iUbpvo2Zm4FB20bYRXuwCxbdxF1UhZxF4kORZkrQ2DL9QY1fbVfkDTeMq+EjqB0b2Ms CiEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=jsXPe6t3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id g5-20020a170902740500b001c9ca0a03e8si262332pll.68.2023.10.11.11.28.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 11 Oct 2023 11:28:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@szeredi.hu header.s=google header.b=jsXPe6t3; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=szeredi.hu Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 22EB78263504; Wed, 11 Oct 2023 11:27:58 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235141AbjJKS1u (ORCPT + 99 others); Wed, 11 Oct 2023 14:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32802 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234976AbjJKS1t (ORCPT ); Wed, 11 Oct 2023 14:27:49 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 708B7B0 for ; Wed, 11 Oct 2023 11:27:47 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-9b98a699f45so16060666b.3 for ; Wed, 11 Oct 2023 11:27:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=szeredi.hu; s=google; t=1697048866; x=1697653666; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=HfuTTDR+nJ6o/M0eow0TQoImOGAmMP0qEOP+RWPlF7Y=; b=jsXPe6t32aXYqLf16ejPQffnyIQK+RRE24WPNmawlpZtdmpeGPbzpKF+UpGQGNv8gj ExM725dg2iExTK56lZUkjLkg+p83sL/u75VgT0Ne5Mbl4RWNxWZjVnt2EsPXkyYGx6NK K/cvq8KZCQlS7Ldw1R984Q5zJhAEkGBume2yI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697048866; x=1697653666; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=HfuTTDR+nJ6o/M0eow0TQoImOGAmMP0qEOP+RWPlF7Y=; b=NEBxIS0wAcJTGfWU0iff94OFLv3ujJcubTEsHHu/Bugr2FkRwuAMMQS5Vdo9NBtwu0 kuzNJk1QI/QpBTXaMlrUewcnCZeJJFQuCqpd0goh1AdWeKoNtSJfmsxvi4D8T1hHqqAm ZMgSUN1lc6KZa4hv+pJqqBTAPZ/xNBrVol3HWkMR/qaqF/NWq6wNMAJeVlYzMbvxwiqj QsEHE7k81obn9yDqg8zP/vC724QjvUyKhq+GqMYVMcw2v5EljG77BiTRu+OyWeUagj72 UmfD/A8sxBIu12YrCdXmsHW02n4aXHl4xmisaqY8Uh7XToPIZDmT+p/9z+NTrkuV3szN 5Z+Q== X-Gm-Message-State: AOJu0YyT+wkvUUyMuCxF/aw8RY9J5h3NmozU4IvJreE3Lw92Bv8lzx8I F9HYQ/QqMjfmjUkoe6JcbXJSapIa8XwQTebO/Y5Cyn9YkmU+O5PP X-Received: by 2002:a17:906:8a50:b0:99c:e38d:e484 with SMTP id gx16-20020a1709068a5000b0099ce38de484mr19331684ejc.6.1697048865820; Wed, 11 Oct 2023 11:27:45 -0700 (PDT) MIME-Version: 1.0 References: <45778432fba32dce1fb1f5fd13272c89c95c3f52.1696043833.git.kjlx@templeofstupid.com> <20231010023507.GA1983@templeofstupid.com> <20231011012545.GA1977@templeofstupid.com> <20231011163220.GA1970@templeofstupid.com> In-Reply-To: <20231011163220.GA1970@templeofstupid.com> From: Miklos Szeredi Date: Wed, 11 Oct 2023 20:27:34 +0200 Message-ID: Subject: Re: [resend PATCH v2 2/2] fuse: ensure that submounts lookup their parent To: Krister Johansen Cc: linux-fsdevel@vger.kernel.org, Miklos Szeredi , linux-kernel@vger.kernel.org, German Maglione , Greg Kurz , Max Reitz , Bernd Schubert Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Wed, 11 Oct 2023 11:27:58 -0700 (PDT) X-Spam-Level: ** On Wed, 11 Oct 2023 at 18:32, Krister Johansen wrote: > > On Wed, Oct 11, 2023 at 09:07:33AM +0200, Miklos Szeredi wrote: > > On Wed, 11 Oct 2023 at 03:26, Krister Johansen wrote: > > > > > I am curious what you have in mind in order to move this towards a > > > proper fix? I shied away from the approach of stealing a nlookup from > > > mp_fi beacuse it wasn't clear that I could always count on the nlookup > > > in the parent staying positive. E.g. I was afraid I was either going to > > > not have enough nlookups to move to submounts, or trigger a forget from > > > an exiting container that leads to an EBADF from the initial mount > > > namespace. > > > > One idea is to transfer the nlookup to a separately refcounted object > > that is referenced from mp_fi as well as all the submounts. > > That seems possible. Would the idea be to move all tracking of nlookup > to a separate refcounted object for the particular nodeid, or just do > this for the first lookup of a submount? Just for submounts. And yes, it should work if the count from the first lookup is transferred to this object (fuse_iget()) and subsequent counts (fuse_dentry_revalidate()) go to the mountpoint inode as usual. This will result in more than one FORGET in most cases, but that's okay. > Would you like me to put together a v3 that heads this direction? That would be great, thanks. Miklos