Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3306763rdh; Mon, 27 Nov 2023 10:44:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IGNrjlwuVnJHOGtjTGkn2ivsWM12XHPXji4njSdwL31ACrG6lhU6inktlyJBp9c28f4KATr X-Received: by 2002:a17:90b:3b90:b0:285:cc9c:74e7 with SMTP id pc16-20020a17090b3b9000b00285cc9c74e7mr4005797pjb.8.1701110665989; Mon, 27 Nov 2023 10:44:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701110665; cv=none; d=google.com; s=arc-20160816; b=tVsj/ICGjTg7T+6MWEuDHzkmCkxzv3p4zdSlxFdkfqZJ0CY2auf5kywYchwccJdItw H5XklAeKSeBAZF8SXK8+E1780kdDjY0coKSjLx+GSaf/cTMK25kQl4VQdseRqHU3Jnkr 6GR6Bp5JAjt0BRR1c/wnVESrMqy3fJGbYbrSibkFraYgmTMCRA4yE/EaNf7t1L0FyFOz xnbzk7bqy3uSl+jdQdGpng1QaDnEQlsvttzdl0StBdWIn3F+SAL/L6/dHO9xu7UDZeLx rH18bDBJRhzKo6OIUO2ZZ/Wu+RXapORUcGu3uZgW0VoQPFciLOYv7NqbDmS9y0XUYebz XFgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date:dkim-signature; bh=tCivESMnwjC6Qdqm7yOK4or8gMne49Hy6vnOquUb2y0=; fh=gvFYJbBmf/2u7XpskHCXm1bGq0MLbIw0TqLqbBf2/nE=; b=xLJwzsyg/5U4TDqebnVCBvO5ndkB+bl5HLN3/7jQcxQCkRSaL0N0WkyUsYrviORHVs +6wMU/Wtooc/CfSjHJRC9acLOQ0P9yGo5tTJmGKwUH1fqkSdYd7byZxGEw1PWM3c04qW nCAT3v1zgBlM8KnCresnSH+emAEEZBqkzplx3KWcfCBOj82EsrmJno0ajaAN6OGLNI4t DkA8r74xBe5hMqLi1T0xLv/Abw4YvBS/ujH49xo+U4EcZ0kz4Ddy/5nBoAkIh4F0J57B 11bj4+5mjJhyuju9p8FcaS7mStegP/UEEOf61IYTUsu+LvpMxshYzkc521hxr+z6xQY/ Hl5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=VK3TcR0X; spf=pass (google.com: domain of linux-ext4+bounces-208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id y8-20020a17090a86c800b00285b3f6bb59si4714663pjv.73.2023.11.27.10.44.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 10:44:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=VK3TcR0X; spf=pass (google.com: domain of linux-ext4+bounces-208-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-ext4+bounces-208-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 3D5AE2817C8 for ; Mon, 27 Nov 2023 18:44:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A63ED32C79; Mon, 27 Nov 2023 18:44:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linux.org.uk header.i=@linux.org.uk header.b="VK3TcR0X" X-Original-To: linux-ext4@vger.kernel.org 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 A2E271A1; Mon, 27 Nov 2023 10:44:15 -0800 (PST) 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=tCivESMnwjC6Qdqm7yOK4or8gMne49Hy6vnOquUb2y0=; b=VK3TcR0XPvsokf+sip3MIrqtLy Z9PojGcz4u7KKhINZ4ZBo/PPmzi8I5yx2w6ajNCQrqS88RZyUWdqdeXDLluB0+ksYZEdBvzjSfJse M1NbZZLGLDFbcznZtzzDuPoErwI5csvP9RLxXfKKxWKFxXV7ZXSi5fe36HSArJLgfLEIKm5H0uO1D 6xkhZfrvDDlOGRLdlHa+E290C45Y8qOo6dtxfHj6rbUk2PdCym42D+HKGXiwCnW/q4xIAHDsvBwIG 9PAHTgHlskrUsj0Sl5Ynjh9QERJgZAZ6Rdom+A/+4TCsuw3aft/nM+nAS55rtfn//eF/3GIPuLP02 aLAVeWwQ==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1r7gaK-00465D-0Y; Mon, 27 Nov 2023 18:43:56 +0000 Date: Mon, 27 Nov 2023 18:43:56 +0000 From: Al Viro To: "Eric W. Biederman" Cc: Gabriel Krisman Bertazi , Linus Torvalds , Christian Brauner , tytso@mit.edu, linux-f2fs-devel@lists.sourceforge.net, ebiggers@kernel.org, linux-fsdevel@vger.kernel.org, jaegeuk@kernel.org, linux-ext4@vger.kernel.org, Miklos Szeredi Subject: Re: fun with d_invalidate() vs. d_splice_alias() was Re: [f2fs-dev] [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs Message-ID: <20231127184356.GK38156@ZenIV> References: <20231123182426.GO38156@ZenIV> <20231123215234.GQ38156@ZenIV> <20231125220136.GB38156@ZenIV> <20231126045219.GD38156@ZenIV> <20231126184141.GF38156@ZenIV> <20231127063842.GG38156@ZenIV> <87jzq3nqos.fsf@email.froward.int.ebiederm.org> <20231127160318.GI38156@ZenIV> <20231127161426.GA964333@ZenIV> <87v89nkqjm.fsf@email.froward.int.ebiederm.org> Precedence: bulk X-Mailing-List: linux-ext4@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87v89nkqjm.fsf@email.froward.int.ebiederm.org> Sender: Al Viro On Mon, Nov 27, 2023 at 12:19:09PM -0600, Eric W. Biederman wrote: > Either we should decide it is useless and remove it and all of it's > children. > > Or we should decide it was renamed and just handle it that way. How? An extra roundtrip to server trying to do getattr on the fhandle we've got? Cost of that aside, we *still* need to dissolve submounts in such case; there is no warranty that we'll ever guess the new name and no way to ask the server for one, so we can't let them sit around. Not that having mounts (local by definition) suddenly show up in the unexpected place because of rename on server looks like a good thing, especially since had that rename on server been done as cp -rl + rm -rf the same mounts would be gone... > If we can record such a decision on the dentry or possibly on the inode > then we can resolve the race by having it be a proper race of which > comes first. > > It isn't a proper delete of the inode so anything messing with the inode > and marking it S_DEAD is probably wrong. s/probably/certainly/, but where would d_invalidate() do such a thing? It's none of its business... > The code could do something like mark the dentry dont_mount which should > be enough to for d_splice_alias to say oops, something is not proper > here. Let the d_invalidate do it's thing. > > Or the code could remove the dentry from inode->i_dentry and keep > d_splice alias from finding it, and it's children completely. > That is different from unhashing it. We might be just in the middle of getdents(2) on the directory in question. It can be opened; we can't do anything that destructive there. Again, it's about the d_invalidate() on ->d_revalidate() reporting 0; uses like proc_invalidate_siblings_dcache() are separate story, simply because there d_splice_alias() is not going to move anything anywhere.