Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp2697988rwe; Sun, 28 Aug 2022 20:11:34 -0700 (PDT) X-Google-Smtp-Source: AA6agR4mV0Fql2r57qYCk8YhxhlvkwO/y2VTdT0K4UxPioqjH7sf+yphPJrQiIE68alJE5vGKVF8 X-Received: by 2002:a17:907:2714:b0:73d:afd7:5f93 with SMTP id w20-20020a170907271400b0073dafd75f93mr12003241ejk.415.1661742694356; Sun, 28 Aug 2022 20:11:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661742694; cv=none; d=google.com; s=arc-20160816; b=iV8SSOBYFQJDH8YqoFIadwsNzTfQt4JwapqvEjKFH9oGxWmnTNBDsXmM3k6BrBZg0m Z1QuMpjVHpvzq5K6M+xhXmkELOsbdlpcpCG0Lfm3inHp5RGvL7OCMXPgNbaLx1U23Jbg OhWi1Hf9kcRTgjFqUBKghlndY8ib8AI8aTpEvU0kN0X7/E46XQ/8QfWdwveAs/pfDQdZ KLR6SeWZs2zIzyYT4AyK4g400v1/yLATu9azgNh1AdkoemDSprzWFdmX3uExzEduTl6c nMxYNmMfjdxeHrr0ZRwNAxjrXOXdYMCsHKVe4nlUVoajD+S4LSMkNeTYLQ/Fpa3fba4H XcHA== 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=o3++mKzz7hERM5Mb7Tdk97SHqozn0mvn+1hqgH12L1w=; b=cKvvxiboEj4kVYXj8aJFmC2r2CMrSbNE7gMdHvEmIfSpCVGoxoxQftXpk64cjz0DQB 1lOB1LYJwI/bEccY0bloehx2ApF1dzs2aY+P7Eo788bo6BoKDZ59EP2HQkaCbstV/LCo JTuLInwtBd5VT/Fsch2y1lUnz2tpXXCldPkzx3mr45iMvRqYVRNVt5+N7qTA+kgNnj04 Hn6zFrfZYf+O32kguw08mBqkkXP5qPp8eECEh2dqMaC7sRr1Xu4obxGDNiL9jzmJJDQi N/P2Bqk7SsAt1BDE4gdDjEpI/vKl4jDPgS6dvNtsyqnWodiDoQlFrTX93HrV3/cGDXDi h0SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=cMe+PbYL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 c8-20020a05640227c800b0043cfed4d661si7402434ede.358.2022.08.28.20.11.00; Sun, 28 Aug 2022 20:11:34 -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=cMe+PbYL; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519; 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 S229776AbiH2DKm (ORCPT + 99 others); Sun, 28 Aug 2022 23:10:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229872AbiH2DKM (ORCPT ); Sun, 28 Aug 2022 23:10:12 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD34E3ED77; Sun, 28 Aug 2022 20:09:32 -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 B849433907; Mon, 29 Aug 2022 03:09:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1661742551; 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=o3++mKzz7hERM5Mb7Tdk97SHqozn0mvn+1hqgH12L1w=; b=cMe+PbYLIGxia+uP9ejOsmr8IkPUBIhxgfpfR89faf9912FvEZNGocOwKktNHmUpjtIhM/ lfk/JsgjdYoe91r/QStr5q+Ts1Li5nX7lMWlQajGuhU/BqhDtWdRRv3V8KbYumOi8iTUyk evT+ZVL17RgJqKNc3Qz15EPyw0CrnUA= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1661742551; 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=o3++mKzz7hERM5Mb7Tdk97SHqozn0mvn+1hqgH12L1w=; b=jaJRdBnq2gSammVoWJlz6ow2/8sW8Csa2EvLviSvu7rxBYw1FRjWSrLVWd7X5QDRlzqZlY 06R2TrNgeQO2idDA== 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 3EC7D133A6; Mon, 29 Aug 2022 03:09:08 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id syyyOtQtDGPJHwAAMHmgww (envelope-from ); Mon, 29 Aug 2022 03:09:08 +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 06/10] VFS: support concurrent renames. In-reply-to: References: <166147828344.25420.13834885828450967910.stgit@noble.brown>, <166147984375.25420.13018600986239729815.stgit@noble.brown>, Date: Mon, 29 Aug 2022 13:08:58 +1000 Message-id: <166174253873.27490.14474856398076056074@noble.neil.brown.name> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,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 Sat, 27 Aug 2022, Al Viro wrote: > On Fri, Aug 26, 2022 at 12:10:43PM +1000, NeilBrown wrote: > > Allow object can now be renamed from or to a directory in which a create > > or unlink is concurrently happening. > > > > Two or more renames with the one directory can also be concurrent. > > s_vfs_rename_mutex still serialises lookups for cross-directory renames, > > but the renames themselves can proceed concurrently. > > Wha...? > Not true, fortunately - you *do* hold ->s_vfs_rename_mutex over the > rename itself. If not for that, it would be utterly broken. > And I don't care for NFS server rejecting that - we are *NOT* taking > loop prevention logics into every filesystem. It's highly non-local > and trying to handle it with your per-dentry flags is going to be > painful as hell, if at all possible. > I don't know what happened there - I let myself get confused somewhere in the process. You are of course right that s_vfs_rename_mutex is held the whole time. I wasn't intending to try to change that. > > + if (d1 < d2) { > > + ok1 = d_lock_update_nested(d1, p1, last1, I_MUTEX_PARENT); > > + ok2 = d_lock_update_nested(d2, p2, last2, I_MUTEX_PARENT2); > > + } else { > > + ok2 = d_lock_update_nested(d2, p2, last2, I_MUTEX_PARENT); > > + ok1 = d_lock_update_nested(d1, p1, last1, I_MUTEX_PARENT2); > > + } > > Explain, please. What's that ordering about? > Deadlock avoidance, just like in the same-directory case. But I guess as s_vfs_rename_mutex is held, ordering cannot matter. I'll remove the ordering. Thanks, NeilBrown