mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@barebox.org>
Subject: [PATCH master] efi: loader: disk: don't install a file system on raw disks
Date: Tue,  3 Nov 2026 15:30:59 +0100	[thread overview]
Message-ID: <20261103143059.853339-1-a.fatoum@pengutronix.de> (raw)

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




                 reply	other threads:[~2026-11-03 14:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20261103143059.853339-1-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=a.fatoum@barebox.org \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox