Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp36078rdh; Wed, 22 Nov 2023 17:12:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGUMuzXNLjwrl9k1F4PIoKseP2EDgJy+g95Kue3qolKMpW/lNQ2XA8XfFqW5Az+JzfjwLMY X-Received: by 2002:a05:6808:f93:b0:3b8:43d2:af6 with SMTP id o19-20020a0568080f9300b003b843d20af6mr2727048oiw.3.1700701957928; Wed, 22 Nov 2023 17:12:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700701957; cv=none; d=google.com; s=arc-20160816; b=BgjARE9Fp5RAQGUtP9m7p0iowdLAW80yCiBEr3HbzoyA5mrgQBLydD+/MTdTV3kHLB Pc4LSiZ/yp3Ell7qmq+DrN+GCarzZsW1tOlpmcMj3JL4I5Qzr98FcFphLFOP6sxteUlR 5kvnwIfofZ0NgT6SV8ZZza1ABZWwd+xvu6tMhmQ0jtInvnKG58c3XKaEO8p/h3UPgutl B2vn3+W6Ehazy7ENiCdYNv0BdgCx5Yy0RAe2qg6Aq9+Ykij6z1Kh1hb0G65ohi6xDZ+h 71Rsj7pzH6Oonybyk4kthIyyofUoV8mB3dpqXUoWwtA1D9tufBxHZsN5IZPRTwJ9jPmc p4aw== 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=PY9S8RVi0dnKEfdrmFsdECJKTXexMrbF0x58rHr1R88=; fh=EC56zrK1cCR0+MNXSpbwKRCx2at6bGt3EsEAPFXz1Rs=; b=YKtCrTB4NHmmYyYPGHHfKqru9kcFMSBh0vgOWoVa9nB4idlHA/Obnk5VKt69uTacy9 8Tieu3qR853uWkvjRKVnzX+AUyrPJ81L5pSzv5PJpaMY/apGRXPuMpEQ/CWNMjp+iz/X ZqZHV+menaeiKPA+FuTar/oW9+JW0qbYNKeLVtq8Ax87tUJ3V5US29kqpoWZ2uTqWpRg jKRDZTdWycQXPAHBj+kmH+ajDCOjB2jPPPjEZnMkSiPz7MrM2t/1e2tOySHV5PsErIA3 Srryg8Y2MNLbOOKY5vqP/LXhrcP8Yg/eaqohxnrYV4ke40fuenNrg7vs2ZjmXUJCLFQl A0rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="Wxreso/B"; spf=pass (google.com: domain of linux-ext4+bounces-95-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-95-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 sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id bq20-20020a056a02045400b005bdfda8e04asi289329pgb.733.2023.11.22.17.12.37 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Nov 2023 17:12:37 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4+bounces-95-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b="Wxreso/B"; spf=pass (google.com: domain of linux-ext4+bounces-95-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-ext4+bounces-95-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 18679B20EEA for ; Thu, 23 Nov 2023 01:12:28 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A4E6517C4; Thu, 23 Nov 2023 01:12:21 +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="Wxreso/B" 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 55A6193; Wed, 22 Nov 2023 17:12:16 -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=PY9S8RVi0dnKEfdrmFsdECJKTXexMrbF0x58rHr1R88=; b=Wxreso/B/Dh4LiFC6ky64hsoHG DKfrqS4iEfOeCiGHQM3PUKYAigdumD8QkqkM/jQrNnbtL9PALDBmElowJuy/vjcngWK/ssk9wCGgQ 9pha+U/3DXFwYydFhuh4n7vom/JGSpqnpVBwi+vRhCN8hnowSDsERumqVCzFcF7HL6DLpsuRZubIe uJoNVzHTqKya2IYBdJncmhtD0Bn+TQOhAMAr00YOEQHEi8wtDoZdFTERTgT8I5sMuO+JlcgvipYjn EkSBN+YD++43nTzDFqkcoWXhZ5Q2CL49AFsyyFeDNtwvVfXowGcRIQ0Ki4Id8+pI9hJb3vx5I5gQL SNSRS68A==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1r5yGG-001rH6-1H; Thu, 23 Nov 2023 01:12:08 +0000 Date: Thu, 23 Nov 2023 01:12:08 +0000 From: Al Viro To: Linus Torvalds Cc: Christian Brauner , Gabriel Krisman Bertazi , 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 Subject: Re: [f2fs-dev] [PATCH v6 0/9] Support negative dentries on case-insensitive ext4 and f2fs Message-ID: <20231123011208.GK38156@ZenIV> References: <20230816050803.15660-1-krisman@suse.de> <20231025-selektiert-leibarzt-5d0070d85d93@brauner> <655a9634.630a0220.d50d7.5063SMTPIN_ADDED_BROKEN@mx.google.com> <20231120-nihilismus-verehren-f2b932b799e0@brauner> <20231121022734.GC38156@ZenIV> <20231122211901.GJ38156@ZenIV> 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: <20231122211901.GJ38156@ZenIV> Sender: Al Viro On Wed, Nov 22, 2023 at 09:19:01PM +0000, Al Viro wrote: > On Tue, Nov 21, 2023 at 02:27:34AM +0000, Al Viro wrote: > > > I will review that series; my impression from the previous iterations > > had been fairly unpleasant, TBH, but I hadn't rechecked since April > > or so. > > The serious gap, AFAICS, is the interplay with open-by-fhandle. > It's not unfixable, but we need to figure out what to do when > lookup runs into a disconnected directory alias. d_splice_alias() > will move it in place, all right, but any state ->lookup() has > hung off the dentry that had been passed to it will be lost. > > And I seriously suspect that we want to combine that state > propagation with d_splice_alias() (or its variant to be used in > such cases), rather than fixing the things up afterwards. > > In particular, propagating ->d_op is really not trivial at that > point; it is safe to do to ->lookup() argument prior to d_splice_alias() > (even though that's too subtle and brittle, IMO), but after > d_splice_alias() has succeeded, the damn thing is live and can > be hit by hash lookups, revalidate, etc. > > The only things that can't happen to it are ->d_delete(), ->d_prune(), > ->d_iput() and ->d_init(). Everything else is fair game. > > And then there's an interesting question about the interplay with > reparenting. It's OK to return an error rather than reparent, > but we need some way to tell if we need to do so. Hmm... int (*d_transfer)(struct dentry *alias, struct dentry *new)? Called if d_splice_alias() picks that sucker, under rename_lock, before the call of __d_move(). Can check IS_ROOT(alias) (due to rename_lock), so can tell attaching from reparenting, returning an error - failed d_splice_alias(). Perhaps would be even better inside __d_move(), once all ->d_lock are taken... Turn the current bool exchange in there into honest enum (exchange/move/splice) and call ->d_transfer() on splice. In case of failure it's still not too late to back out - __d_move() would return an int, ignored in d_move() and d_exchange() and treated as "fail in unlikely case it's non-zero" in d_splice_alias() and __d_unalias()... Comments? Note that e.g. res = d_splice_alias(inode, dentry); if (!IS_ERR(fid)) { if (!res) v9fs_fid_add(dentry, &fid); else if (!IS_ERR(res)) v9fs_fid_add(res, &fid); else p9_fid_put(fid); } in 9p ->lookup() would turn into v9fs_fid_add(dentry, &fid); return d_splice_alias(inode, dentry); with ->d_transfer(alias, new) being simply struct hlist_node *p = new->d_fsdata; hlist_del_init(p); __add_fid(alias, hlist_entry(p, struct p9_fid, dlist)); return 0; assuming the call from __d_move()...