Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2824714pxb; Sun, 3 Oct 2021 06:46:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJymTT7kCQkQ/yOn3gqWNdSNP01OjHUb/1QoyEuX77BXOrncfbDeFGD0qJ11h68Z2zP8GrjB X-Received: by 2002:a17:90a:1984:: with SMTP id 4mr24782596pji.87.1633268811688; Sun, 03 Oct 2021 06:46:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633268811; cv=none; d=google.com; s=arc-20160816; b=fFsRHtqqDbC/A9yPAsrdwUyvSgaOPtmAYXSfQkhkqf2w0TtfSOMnGfj29U/XKvF641 rWnJvKvYT9DmkB89qSKuxbkUIT8R9W2vI4qDIBLC8NIzAeHrgCW2Jloj4H7RWme91YTg qJkQQCMD9dmySqYNgE5j94wNegD6mKQmxuUwVJRMbUpp4cYj04VePUHY37lXEwlVy4ce Oq3vKt2S0lZGpnyCb6K+uVZInB6qEb6qH1vM8i65gEa2PcGwz3dzRVKfDPEz59Yrzcdh vx4YLbMyh4Jm7ssjeP6hIhEBND63fgAfgUgEFv/8UUJPmMPxtuVLz2ENUx839pWOIFcJ KzcQ== 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; bh=gOmlLHJQtMGIXWLc25AvIsQ1E8Kf1xle9OHS+bn2OyI=; b=RH0WKClxpVzZbw5LchuJhY/VL4SFukxaK3xJP0+Uf75slHS2se9WEJPUeA5Xku5GXL HOc6s9lICx/BhkptKukvPOtad3zsgIPDbhjSDV0hkLQKxH/+9dgBxbDTZ1eIwFICH83X 9/DVekt6kkAAMWOnotq870xlCKljONW1yvi96jXuM2lhh2XAx+Tm3UkEoF7D6rrSr/d3 nhxpqUYT8vyJ7Om2gW4RxuXZvOsRFigifrmakobu4LgqNiWdCx4wPYlp0einSCF2KSoo rKxSauEH5IM09MlPFB9PgS3/tfVaqMhjdIcQEfi5P0ckeLZ47zxooIMb4qtVl5eJuymi p7qA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m125si14314405pfb.54.2021.10.03.06.46.29; Sun, 03 Oct 2021 06:46:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230328AbhJCNox (ORCPT + 99 others); Sun, 3 Oct 2021 09:44:53 -0400 Received: from zeniv-ca.linux.org.uk ([142.44.231.140]:50072 "EHLO zeniv-ca.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230506AbhJCNow (ORCPT ); Sun, 3 Oct 2021 09:44:52 -0400 Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mX1hQ-009dmQ-PD; Sun, 03 Oct 2021 13:38:40 +0000 Date: Sun, 3 Oct 2021 13:38:40 +0000 From: Al Viro To: Shreeya Patel Cc: tytso@mit.edu, adilger.kernel@dilger.ca, krisman@collabora.com, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH 1/2] fs: dcache: Handle case-exact lookup in d_alloc_parallel Message-ID: References: <0b8fd2677b797663bfcb97f6aa108193fedf9767.1632909358.git.shreeya.patel@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0b8fd2677b797663bfcb97f6aa108193fedf9767.1632909358.git.shreeya.patel@collabora.com> Sender: Al Viro Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Sep 29, 2021 at 04:23:38PM +0530, Shreeya Patel wrote: > There is a soft hang caused by a deadlock in d_alloc_parallel which > waits up on lookups to finish for the dentries in the parent directory's > hash_table. > In case when d_add_ci is called from the fs layer's lookup functions, > the dentry being looked up is already in the hash table (created before > the fs lookup function gets called). We should not be processing the > same dentry that is being looked up, hence, in case of case-insensitive > filesystems we are making it a case-exact match to prevent this from > happening. NAK. What you are doing would lead to parallel calls of ->lookup() in the same directory for names that would compare as equal. Which violates all kinds of assumptions in the analysis of dentry tree locking. d_add_ci() is used to force the "exact" spelling of the name on lookup - that's the whole point of that thing. What are you trying to achieve, and what's the point of mixing that with non-trivial ->d_compare()? If it's "force to exact spelling on lookup, avoid calling ->lookup() on aliases", d_add_ci() is simply not a good match.