Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1012726rwe; Fri, 26 Aug 2022 21:24:23 -0700 (PDT) X-Google-Smtp-Source: AA6agR5eTRJgY8W/JTDZN0khGLRPFB+DTs9R+gRbaCLyRLtShSp2qAHdahGgKpWXBsQzBsnBCtW5 X-Received: by 2002:a63:5c42:0:b0:42b:452f:8e66 with SMTP id n2-20020a635c42000000b0042b452f8e66mr5793023pgm.323.1661574263169; Fri, 26 Aug 2022 21:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661574263; cv=none; d=google.com; s=arc-20160816; b=b8N1KF73DUxK6pn+Xm+iPVrDZuFUCChvEISl6ew8tssxrciKpX6/IHPMaguI4q/iSo r/SgHoT7zCS4y7uM38bRYAIivD1lGAFTn8MGCTg9D7MEI0IAPoBoDpobqMLldslVN5UX fFBYwi34faE1bEbeSRqPYPBk4zK9TniLjOQeZV1WJV4/BCEN01qxu8RiN5oSfpO+VvMT zDyKVcM9ZOn74XzhGFlSUAS4st4EcBoGHOjH8qd5SwVf1HI8qeE7q+N6wZ177RCcdBPN CcSg+F5Y4MAMdkDYzDuwRc4SeR09xmKcHdeQshzJAbcABdUOEeUoIsQICqVSkT1t5RMd SBrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=wadOyvrfdeTNJP7k+clc6E/o5sdU8g+XeH3gXjpuwdI=; b=ZFhmfrnN1+6HTXZlAEKuSZ1w3fowFmtg8VojkfocVcbYjShUsEe0QBVjm7nNqgLs6j NvBthQCNzu51KevUKU9HT7eyV9yNU0M2YOYPLt7ZWoxO5L3EtA7udn1IhyF2vSAp7qdK 2ZqDgGBYlBXsYOlKOAVkiSHquD8PfHGEkSzTxps1BCanK66J3nH+7c4DiI/pDhGv2h09 dxdQf8LXFkMnmVqTBACjdl5K/M7yb73cbsUqiFlro3apKjR+KWwilmy6jR2cyNzwyIYw Q95oqqUxur1X0yCfGTxkEVOO79pexMVf9k/kq47pohefwBPzMQpyvHZ3NjihVNnuDGJ9 XuEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=efG7rexK; 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=zeniv.linux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pv4-20020a17090b3c8400b001faa7b96ca0si3511651pjb.13.2022.08.26.21.23.57; Fri, 26 Aug 2022 21:24:23 -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=@linux.org.uk header.s=zeniv-20220401 header.b=efG7rexK; 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=zeniv.linux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232194AbiH0EM4 (ORCPT + 99 others); Sat, 27 Aug 2022 00:12:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbiH0EMz (ORCPT ); Sat, 27 Aug 2022 00:12:55 -0400 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 86C84E1A86; Fri, 26 Aug 2022 21:12:54 -0700 (PDT) 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=wadOyvrfdeTNJP7k+clc6E/o5sdU8g+XeH3gXjpuwdI=; b=efG7rexKymyWdZYiYWCBrdcw1J yGcHif/DBfNYpOUqiHcBKNP8zbfBF6D2eiiQmJpKeAn+MfKxWG8ZIKkZhkLoASBaJLqnIUK1soKnD ajKfqytf3msa9oOkMGXO2HkOu2QejMrgtGp3V/49Z5mRzoz99q+I6lc94M4IMxeajLL7T8dL796+M D8+BxnylZ/AxUrr4lQwHRN46+XL65vD35U8/iAhuGU0IRT6HkDeGkoLNz81tC/gyjuZcbOx14+Wb8 m12wspQ3/wjhaa7vhGb+T3F6LXyGGV4cDIhQ0yiL5UJ5VhIoKkF3IW9V4+Sgw8ZuUrMCZYyMPTQGZ oeWgEM1w==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.95 #2 (Red Hat Linux)) id 1oRnBd-008s4P-Vk; Sat, 27 Aug 2022 04:12:46 +0000 Date: Sat, 27 Aug 2022 05:12:45 +0100 From: Al Viro To: NeilBrown 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. Message-ID: References: <166147828344.25420.13834885828450967910.stgit@noble.brown> <166147984375.25420.13018600986239729815.stgit@noble.brown> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <166147984375.25420.13018600986239729815.stgit@noble.brown> Sender: Al Viro X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE,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 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. > + 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?