Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp5118145pxb; Thu, 14 Oct 2021 20:00:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJ1UaKDV/r1X+hHkEzDBFW3V8OXVDUsmU7DIl+OCRfD8PyJLg8QAZcMyKwAfl9p2Yje70U X-Received: by 2002:a17:90a:b117:: with SMTP id z23mr24995193pjq.74.1634266800545; Thu, 14 Oct 2021 20:00:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634266800; cv=none; d=google.com; s=arc-20160816; b=MvpULt2ay7O+A8DJ1nHuJ+7HigNg6B5kptFEx+Q0qaedTNtObu7BUO5C0Alp3sMQbV D2SmOAVoZrRMx5q8VxV2dQeKAokwM8HSxFJBmjo48Lm/mf09Z36JZKnLcuOpfjBQOv2Z 84CM3qCGeH+yxPnBudGUZfd0KOKUfRbnWckqpCJNt8lrI0k894yZfqEJKoM29iZIhiBW rC3EjDQB0j4CIV/TMc+/xkInXg7UZh4sXd99C1qmGBu0Y5+KfxQqDPEXxzruQyDv8mMY 06F2B2HUiEefqr7Tx9CNP5u1Xy9KOa4lrDnu23/9vY4JZsh+W29QAUGtWgn+UfJTrYo8 1Jtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:organization:subject:cc:to:from; bh=4VEYJpzDYD/FQJcaf6GMCYDTFK/PLNdGRep+5XP/cmU=; b=PdtDCO2Yujyfh11TwYo8x+dq51RrBSthd8P7kwRsRS98ExDNmJqku34REwnVUuJHs+ 4uizYgsjcLzT1X0RW4L27ldImOy2IO04s99lFSC0q9YEmJWDA5XzYAex8ZPWTlYtxC57 t05kxtppDlTn8wt/tT0kl85zy9ElSUsBwZI1s/sMl8Fp12fMTTfns5BqMjULIY8WAS6M anLDfYNbMbtpX/ALWCrFoTGB22LwToVtMo3UczFrP3j7zJZjljGt4Ge0FpL9i+DLz81V +UdpCtQXn5bJghl0mmCq0bsgKRA8CGN2d6phX1o7yO+rSXQqjgA+Aehe8CoVA3XZQZp4 0uRA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si5976630plp.268.2021.10.14.19.59.36; Thu, 14 Oct 2021 20:00:00 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232773AbhJNV4w (ORCPT + 99 others); Thu, 14 Oct 2021 17:56:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56854 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232055AbhJNV4v (ORCPT ); Thu, 14 Oct 2021 17:56:51 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E82CC061570; Thu, 14 Oct 2021 14:54:46 -0700 (PDT) Received: from localhost (unknown [IPv6:2804:14c:124:8a08::1007]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: krisman) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 869B11F44F68; Thu, 14 Oct 2021 22:54:44 +0100 (BST) From: Gabriel Krisman Bertazi To: "Theodore Ts'o" Cc: Shreeya Patel , viro@zeniv.linux.org.uk, adilger.kernel@dilger.ca, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@collabora.com Subject: Re: [PATCH 2/2] fs: ext4: Fix the inconsistent name exposed by /proc/self/cwd Organization: Collabora References: <8402d1c99877a4fcb152de71005fa9cfb25d86a8.1632909358.git.shreeya.patel@collabora.com> <8735pk5zml.fsf@collabora.com> Date: Thu, 14 Oct 2021 18:54:31 -0300 In-Reply-To: (Theodore Ts'o's message of "Fri, 1 Oct 2021 21:21:33 -0400") Message-ID: <8735p3gtm0.fsf@collabora.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org "Theodore Ts'o" writes: > On Fri, Oct 01, 2021 at 03:11:30PM -0400, Gabriel Krisman Bertazi wrote: >> >> The dcache name is exposed in more places, like /proc/mounts. We have a >> bug reported against flatpak where its initialization code bind mounts a >> directory that was previously touched with a different case combination, >> and then checks /proc/mounts in a case-sensitive way to see if the mount >> succeeded. This code now regresses on CI directories because the name >> it asked to bind mount is not found in /proc/mounts. > > Ah, thanks for the context. That makes sense. > >> I think the more reasonable approach is to save the disk exact name on >> the dcache, because that is the only version that doesn't change based >> on who won the race for the first lookup. > > What about the alternative of storing the casefolded name? The > advantage of using the casefolded name is that we can always casefold > the name, where as in the case of a negative dentry, there is no disk > exact name to use (since by definition there is no on-disk name). That would work. The casefolded version is always predictable (since unicode is stable) and even though is not as easily available as the disk name function (getdents), it solves the issue. It would also allow us to use utf8_strncasecmp_folded in the d_compare hook, which is nice. Do you have an implementation suggestion to solve the dcache issue pointed by Viro? -- Gabriel Krisman Bertazi