From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 89656941BCE for ; Thu, 28 Sep 2023 17:57:22 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=pEWDE7zs5PbxPtWa9bcGizMvBW7Y26v2/qfQPO7NVKM=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1695923841; v=1; b=eK2iVquF6VM6fSB8/ROoXjG1P7q0fGR4admsGa2q2+Ku8DuY+n4blJT1WOwb/rE/bbOhlf3n NMfxqzV47+83qINch/KBdHGo+R2ovZnRBzmvVwwBlu4vWmkNWaboMrnvXKuTT9yfImW8PlokiZh ML+XnbJCHwa4GvzcrCgmd5kc= X-Received: by 127.0.0.2 with SMTP id jR5XYY7687511xfugzbL6nNf; Thu, 28 Sep 2023 10:57:21 -0700 X-Received: from mail-vk1-f179.google.com (mail-vk1-f179.google.com [209.85.221.179]) by mx.groups.io with SMTP id smtpd.web11.20122.1695923840635458628 for ; Thu, 28 Sep 2023 10:57:20 -0700 X-Received: by mail-vk1-f179.google.com with SMTP id 71dfb90a1353d-49040dc5cedso5003755e0c.3 for ; Thu, 28 Sep 2023 10:57:20 -0700 (PDT) X-Gm-Message-State: RHrBLAZwOfylRYhtaZOO3YYLx7686176AA= X-Google-Smtp-Source: AGHT+IFbqiVvdRAvmHqMLznLfFUXYunJt8BJuzMsi+02WkVW76RBl+jN4vw+Z/v0actrjMQtK/XpvPLcYcDrSTfr3kU= X-Received: by 2002:a1f:4ec4:0:b0:49a:9a34:ec40 with SMTP id c187-20020a1f4ec4000000b0049a9a34ec40mr1686617vkb.2.1695923839630; Thu, 28 Sep 2023 10:57:19 -0700 (PDT) MIME-Version: 1.0 References: <6odzwzflo4id7ra3cphgk3rhfpr7iqojsfqkbu4tutapcyhk2v@njifptgxmw5n> In-Reply-To: <6odzwzflo4id7ra3cphgk3rhfpr7iqojsfqkbu4tutapcyhk2v@njifptgxmw5n> From: "Pedro Falcato" Date: Thu, 28 Sep 2023 18:57:08 +0100 Message-ID: Subject: Re: [edk2-devel] efi and ext4 and case sensitive file names To: Gerd Hoffmann Cc: devel@edk2.groups.io Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=eK2iVquF; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Wed, Sep 27, 2023 at 1:09=E2=80=AFPM Gerd Hoffmann w= rote: > > Hi, > > I've noticed that the edk2 ext4 driver does case-insensitive filename > matching. I know the fat filesystem is case-insensitive, and the uefi > spec describing the fat filesystem also explicitly says it is > case-insensitive. On a quick scan I can't find anything in the uefi > spec requiring *all* filesystem drivers being case-insensitive though. > > So I'm wondering whenever the ext4 driver behavior is correct. It > certainly is different than the linux kernel's behavior which is (by > default) case-sensitive. Ok, so this is a funny problem. When I was originally writing it, I noticed a good few consumers would expect case insensitiveness, so I ended up needing case insensitive string comparison. As an example, in my current system: Boot0001* ARCHLINUX HD(1,GPT,7e1b2e20-3013-4683-b8ab-bef1f9bfb1c8,0x800,0x32000)/File(\EFI\ARCH= LINUX\GRUBX64.EFI) whereas the GRUB tooling installed itself as: /boot/efi/EFI/ARCHLINUX/grubx64.efi I treated some good bits of the filesystem driver as "should remain similar to FAT" due to compatibility reasons. I really really wouldn't be surprised if lots of EFI code out there relied on case insensitiveness or other FAT-ish stuff, instead of UNIX semantics. (funnily enough, EFI also has the restriction where every filename must be valid unicode, which is not the case on most UNIX systems out there, that take the file name as "bag of bytes - '/'") > > Also note that the linux kernel ext4 driver recently got support for > case-insensitive file names, which must be explicitly enabled for both > filesystems (EXT4_FEATURE_INCOMPAT_CASEFOLD) and directories > (EXT4_CASEFOLD_FL). Ugh, this is annoying, they didn't even bother documenting it... (https://www.kernel.org/doc/html/latest/filesystems/ext4/globals.html#super= -incompat) This leaves me in the awkward spot where figuring the behavior out would require me to read the fs/ext4 code and thus be legally dubious, yay :^) > > On practical terms I've ran into actual problems due to Fedora mounting > the ESP at /boot/efi[1] and UKIs (unified kernel images) should be > placed in EFI/Linux on either ESP or XBOOTLDR partition, which on fedora > translates to /boot/efi/EFI/Linux (ESP) or /boot/EFI/Linux (XBOOTLDR). > So I have both /boot/efi and /boot/EFI ... Oh boy, that seems fun. So Ext4Dxe can only open one of the two dirs, right= ? Now that I think of it, there should be fun behavior when doing an EFI readdir, where you could find two dirents with "different" names but then opening both will lead to the same dirent being open twice... yuck --=20 Pedro -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109173): https://edk2.groups.io/g/devel/message/109173 Mute This Topic: https://groups.io/mt/101615699/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-