Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp2482239rwb; Sun, 4 Sep 2022 17:25:50 -0700 (PDT) X-Google-Smtp-Source: AA6agR5bmsHGp0k5VyoboJiKhXPlZnY0jfsE0XnleGoIINxSx808YQwU+3Tbvofm7ZNhF74PsfoC X-Received: by 2002:a05:6402:3507:b0:448:b672:55ee with SMTP id b7-20020a056402350700b00448b67255eemr24785952edd.107.1662337550181; Sun, 04 Sep 2022 17:25:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662337550; cv=none; d=google.com; s=arc-20160816; b=oK4uvwVm29nnl/9ZrINPiNQsHFKny33KLeBffmkWyD6I12LuIQZdCyv9aq7s5a8FJ5 OyT1BWrIj0J6U9t2yylTJSKg9Y2jj7pDPLTD7NHRoyZBOCVrodPq6/2Cp44uxiYXNcLa ir/pyA0//ZOw5mVYT3vMHplUCUmCvuBIuxiLA3k3Nx3MSw8TMSZS+nU+3XYJiDH/nTb+ QMI+6wZp2/i9r9Zm5wIQAVJdy83EdXlIhjpJjeq/5msJoC7v6QBjJR/6k9zgeAeXUHmo CbiEE6StClbZR9b9z4Cmqu0SdVVq4cR2rdGbC0mdXs3HrBgbUKDTbpnlkQIKoQEhUQGl Jw+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:references:in-reply-to:subject :cc:to:from:mime-version:content-transfer-encoding:dkim-signature :dkim-signature; bh=7wL1UsufC/2TYfqXALUnz3P66S7/A6vXRUT/r091DT4=; b=veRHZ+EWh5dSZiHgaraVKHd+Zd0J/KCDCNIFHAQvY0pRjLg6t3B8NKLYwXSyz9dYH8 Fe0WM+m1upz2fITtZQMQYY8pv5Ksabcr96kaGChKmWKTzAp0y1ZadCovPlPXUonB8/ij qn1qP8Ti9S/0+K3ah17mogO2f8RvyyOpRWroL3sn0d5oe44CBvjtd+F21f26CpgWkgHo YgmXQOqM3D9vyjMJHH62VTKu1BdrKFYFG8oeDIxKBChFdCp0tNKHdcYHCmU4iWm1v8pb aiy5pB4El6hi/s+vLeYs2rkaWprux+DFM5h61ryd/dmlUPeFYcyWw4cJDZfjtcCD7qd4 XeOw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=f8BWz4lj; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x17-20020a170906659100b00731110cfdb8si5618112ejn.934.2022.09.04.17.25.08; Sun, 04 Sep 2022 17:25:50 -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=@suse.de header.s=susede2_rsa header.b=f8BWz4lj; dkim=neutral (no key) header.i=@suse.de; 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=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231221AbiIDXdt (ORCPT + 99 others); Sun, 4 Sep 2022 19:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229596AbiIDXdt (ORCPT ); Sun, 4 Sep 2022 19:33:49 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [IPv6:2001:67c:2178:6::1c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A0BD2175BA; Sun, 4 Sep 2022 16:33:47 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4167B384DC; Sun, 4 Sep 2022 23:33:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1662334426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7wL1UsufC/2TYfqXALUnz3P66S7/A6vXRUT/r091DT4=; b=f8BWz4ljqyxYbb137zDcgOkYYHXQujZkE9DWZOp0lS43pGNbF03cnJy8y/j0uPSNDDrBeb 9JxCdGcNtLlsrxcmcc2fVrOjflOfpq7TTAu9MriUJ0M0aSXu9aI3ead9L8OTlGiwegbTLL BLCMup/Uetf5uyTBu9GSh8KYGb8UYvc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1662334426; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7wL1UsufC/2TYfqXALUnz3P66S7/A6vXRUT/r091DT4=; b=n6SGdhfUq336qP/umCt+2NKS9PG0OdSxLxLz3/qyL73I6lHuHnkHIuCvW7CXZ9/pyUNAdP ZwYtsbwVnhCqBCBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id C90EF13A6B; Sun, 4 Sep 2022 23:33:43 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id hP36INc1FWOSYAAAMHmgww (envelope-from ); Sun, 04 Sep 2022 23:33:43 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: "Al Viro" Cc: "Linus Torvalds" , "Daire Byrne" , "Trond Myklebust" , "Chuck Lever" , "Linux NFS Mailing List" , linux-fsdevel@vger.kernel.org, "LKML" Subject: Re: [PATCH 01/10] VFS: support parallel updates in the one directory. In-reply-to: References: <166147828344.25420.13834885828450967910.stgit@noble.brown>, <166147984370.25420.13019217727422217511.stgit@noble.brown>, , <166173834258.27490.151597372187103012@noble.neil.brown.name>, , <166216924401.28768.5809376269835339554@noble.neil.brown.name>, , Date: Mon, 05 Sep 2022 09:33:40 +1000 Message-id: <166233442086.1168.1631109347260612253@noble.neil.brown.name> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Sun, 04 Sep 2022, Al Viro wrote: > On Sat, Sep 03, 2022 at 03:12:26AM +0100, Al Viro wrote: > > > Very much so. You are starting to invent new rules for ->lookup() that > > just never had been there, basing on nothing better than a couple of > > examples. They are nowhere near everything there is. > > A few examples besides NFS and autofs: Hi Al, thanks for these - very helpful. I will give them due consideration when I write relevant documentation to include in the next posting of the series. Thanks a lot, NeilBrown > > ext4, f2fs and xfs might bloody well return NULL without hashing - happens > on negative lookups with 'casefolding' crap. > > kernfs - treatment of inactive nodes. > > afs_dynroot_lookup() treatment of @cell... names. > > afs_lookup() treatment of @sys... names. > > There might very well be more - both merged into mainline and in > development trees of various filesystems (including devel branches > of in-tree ones - I'm not talking about out-of-tree projects). > > Note, BTW, that with the current rules it's perfectly possible to > have this kind of fun: > a name that resolves to different files for different processes > unlink(2) is allowed and results depend upon the calling process > > All it takes is ->lookup() deliberately *NOT* hashing the sucker and > ->unlink() acting according to dentry it has gotten from the caller. > unlink(2) from different callers are serialized and none of that > stuff is ever going to be hashed. d_alloc_parallel() might pick an > in-lookup dentry from another caller of e.g. stat(2), but it will > wait for in-lookup state ending, notice that the sucker is not hashed, > drop it and retry. Suboptimal, but it works. > > Nothing in the mainline currently does that. Nothing that I know of, > that is. Sure, it could be made work with the changes you seem to > imply (if I'm not misreading you) - all it takes is lookup > calling d_lookup_done() on its argument before returning NULL. > But that's subtle, non-obvious and not documented anywhere... > > Another interesting question is the rules for unhashing dentries. > What is needed for somebody to do temporary unhash, followed by > rehashing? >