* [PATCH master] efi: loader: disk: don't install a file system on raw disks
@ 2026-11-03 14:30 Ahmad Fatoum
2026-11-06 10:03 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Ahmad Fatoum @ 2026-11-03 14:30 UTC (permalink / raw)
To: barebox; +Cc: Ahmad Fatoum
From: Ahmad Fatoum <a.fatoum@barebox.org>
efi_fs_exists() matches the detected type of a cdev against the type of
every registered file system driver. Drivers not backed by a cdev, like
ramfs, devfs or tftp, leave their type at filetype_unknown, so every
disk with unrecognized content matches one of them.
Let's skip filetype_unknown like fs_detect() does, so raw disks only
export Block I/O.
Fixes: 3146c70b0f8b ("efi: loader: protocol: add Block IO support")
Signed-off-by: Ahmad Fatoum <a.fatoum@barebox.org>
---
efi/loader/protocols/disk.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/efi/loader/protocols/disk.c b/efi/loader/protocols/disk.c
index 493be8c5aafe..d56c9116460d 100644
--- a/efi/loader/protocols/disk.c
+++ b/efi/loader/protocols/disk.c
@@ -163,7 +163,8 @@ static bool efi_fs_exists(struct cdev *cdev)
enum filetype filetype;
struct driver *drv;
- if (cdev_detect_type(cdev, &filetype))
+ /* drivers not backed by a cdev, e.g. ramfs, have no type to match */
+ if (cdev_detect_type(cdev, &filetype) || filetype == filetype_unknown)
return false;
bus_for_each_driver(&fs_bus, drv) {
--
2.47.3
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH master] efi: loader: disk: don't install a file system on raw disks
2026-11-03 14:30 [PATCH master] efi: loader: disk: don't install a file system on raw disks Ahmad Fatoum
@ 2026-11-06 10:03 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2026-11-06 10:03 UTC (permalink / raw)
To: barebox, Ahmad Fatoum; +Cc: Ahmad Fatoum
On Tue, 03 Nov 2026 15:30:59 +0100, Ahmad Fatoum wrote:
> efi_fs_exists() matches the detected type of a cdev against the type of
> every registered file system driver. Drivers not backed by a cdev, like
> ramfs, devfs or tftp, leave their type at filetype_unknown, so every
> disk with unrecognized content matches one of them.
>
> Let's skip filetype_unknown like fs_detect() does, so raw disks only
> export Block I/O.
>
> [...]
Applied, thanks!
[1/1] efi: loader: disk: don't install a file system on raw disks
https://git.pengutronix.de/cgit/barebox/commit/?id=a4951b1e1d52 (link may not be stable)
Best regards,
--
Sascha Hauer <s.hauer@pengutronix.de>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-06 10:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03 14:30 [PATCH master] efi: loader: disk: don't install a file system on raw disks Ahmad Fatoum
2026-11-06 10:03 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox