Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp848462rdh; Thu, 23 Nov 2023 22:15:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2ucq8BWqbfkPpOU1fRjPP4F45bjFqRnPArTvL59LUAFgJZQ93VnLuzHwCscSmNGlmPzV/ X-Received: by 2002:a54:4499:0:b0:3b8:339a:85de with SMTP id v25-20020a544499000000b003b8339a85demr1899941oiv.13.1700806551873; Thu, 23 Nov 2023 22:15:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700806551; cv=none; d=google.com; s=arc-20160816; b=nJRBYhoPLJlxgptywiWCDtw3/iTWiJKd40SJXeCCiMNpMDoOwInQtedRqTtrfVxvLi LvXZuiP9hkndjKYkaydUo1DKrptHef3yab1TsztLysrcTVZFdum4WvogTK5U+OWrq/ni NELrwSGuj9BJHR34X8HbAle/0Q9llUech579hLYquTcNcqHGHFGGskUVmwHjNcss92sM xN5jQTXNm9fx8MdIZdQDvhvdmv1+PFQD7FykbSSTdmdByPjWqxZ0aih/5IX9snN5gpgC JUAmS21HVlqFiz7LHezH+jv2UKO5C8T390pryaz7haKzuB+9mV91JarRGJsSEKSYjjE6 DY9Q== 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=iitzqEcqy2/NvHpJVilvHrDiSq6ioct471RtcAQWPEc=; fh=2MphlDTB2pOe9U63OacS2R6GvRPcasQQjDMQjWVE1cE=; b=YNyO6ayPcbihEz78xX1jHFpcfe3FqjjXPjE8M+NInnpbUE4XMvLVAGwh9aXT5y5Rxq dS+WiLO2GDcE+tn8UoGx9YGutwjxcS1m3CL/45vrert+tXDytmpp5PCoF+CVZ9zxh9QJ MG5u1VB38CIACJ72edfI7iQRoDvrWflvgB75i+pDyOwOBNH9jaKgc5BDYhnX9x1oQQpa z/yAsMVEs3hJA7Z/Gdp9miyG3xPBZTPdakJJcRTbqGbX5dWVv5KrYIhzxMTZ3INAQ7Qd ZZF6+nZ7a8zf827iJf5El85KX7Lc9D444QDnIT8HFww5VZvju/lxENI91BpmdPS/uZo4 IVnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=RLknA5n6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id e189-20020a6369c6000000b00577461296a9si2916383pgc.338.2023.11.23.22.15.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Nov 2023 22:15:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.org.uk header.s=zeniv-20220401 header.b=RLknA5n6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zeniv.linux.org.uk Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id C627D80859AC; Thu, 23 Nov 2023 22:15:31 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229827AbjKXGPQ (ORCPT + 99 others); Fri, 24 Nov 2023 01:15:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51396 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229453AbjKXGPP (ORCPT ); Fri, 24 Nov 2023 01:15:15 -0500 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 C09EAD6F; Thu, 23 Nov 2023 22:15:21 -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=iitzqEcqy2/NvHpJVilvHrDiSq6ioct471RtcAQWPEc=; b=RLknA5n6GG7PuJuFB/06MrnTp5 K9hmIcs/BPIcg4G6vog2iZx2aNKOQgUTSGSbk0pcleHaJ7d7t/7B5FRcyRHynMjvzWTKe2i6JdEOm 9IqomBGGvJA89OOvgrEimkS/GYCWd0ORsUE2+HZLzeJYWxZQXhgCz3D8XDcjSK0kD2e467a/3p8S1 00+I2xUzkUGIcW+OI38iiIT1ibkJjuM3mLvbkBJ2Zxr3I0tZATM5y1V3g/cIsOfIJuJigZ74Taj6y c4fV3B8tsVQVt1dLi76J0NmYEEl3gG6PZTIK06g7Z6IizA2nQIjxkjxghs/feEyc7FtZbP/KdANep vO2vZqqw==; Received: from viro by zeniv.linux.org.uk with local (Exim 4.96 #2 (Red Hat Linux)) id 1r6PTC-002QBO-37; Fri, 24 Nov 2023 06:15:19 +0000 Date: Fri, 24 Nov 2023 06:15:18 +0000 From: Al Viro To: Jan Kara Cc: linux-fsdevel@vger.kernel.org, Linus Torvalds , Mo Zou , linux-kernel@vger.kernel.org Subject: Re: [PATCH 9/9] rename(): avoid a deadlock in the case of parents having no common ancestor Message-ID: <20231124061518.GS38156@ZenIV> References: <20231122193028.GE38156@ZenIV> <20231122193652.419091-1-viro@zeniv.linux.org.uk> <20231122193652.419091-9-viro@zeniv.linux.org.uk> <20231123103622.4mfjwrmxr4tl53hi@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231123103622.4mfjwrmxr4tl53hi@quack3> Sender: Al Viro X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 23 Nov 2023 22:15:31 -0800 (PST) On Thu, Nov 23, 2023 at 11:36:22AM +0100, Jan Kara wrote: > It would look more natural to me if s_vfs_rename_mutex got dropped in the > callers (lock_rename(), lock_rename_child()) which have acquired the lock > instead of here. I agree it results in a bit more boiler plate code though. finish_locking_two_parents(), perhaps? ;-) Seriously, though - it starts with ->s_vfs_rename_mutex and ends with the environment for vfs_rename() or with all locks dropped.