From: AKASHI Takahiro <takahiro.akashi@linaro.org>
To: u-boot@lists.denx.de
Subject: [U-Boot] [BUG] efi_driver: crash while reading from iSCSI drive
Date: Wed, 23 Oct 2019 19:30:22 +0900 [thread overview]
Message-ID: <20191023103021.GG10448@linaro.org> (raw)
In-Reply-To: <1663f155-e50f-f4fd-6eee-0298fda255c0@gmx.de>
On Tue, Oct 22, 2019 at 10:29:09PM +0200, Heinrich Schuchardt wrote:
> The patch
>
> commit 867400677cda0fac4a411f1549fe3a61bb5ed172
> efi_loader: disk: install FILE_SYSTEM_PROTOCOL only if available
>
> breaks booting my Pine A64 LTS board via iPXE and GRUB. But I assume
> this is not at the base of the problem.
>
> My iSCSI drive is partitioned like this:
>
> Device Boot Start End Sectors Size Id Type
> pine-a64-lts1 2048 194559 192512 94M ef EFI vfat
> pine-a64-lts2 * 194560 2148351 1953792 954M 83 Linux ext2
> pine-a64-lts3 2148352 25585663 23437312 11.2G 83 Linux ext4
> pine-a64-lts4 25585664 67106815 41521152 19.8G 83 Linux ext4
>
> Looking at the debug output below the following questions arise:
>
> Why is ext2 not recognized as a file system?
> Why is the system crashing when trying to read 1024 blocks from the ext4
> partition?
Try the workaround attached below.
It seems that some fields, particularly log2blksz, in blk_dev held by
ext_fs(of ext_filesystem in fs/ext4/ext4fs.c) are not initialized.
I think that ext4's initialization code should be reworked.
-Takahiro Akashi
diff --git a/lib/efi_loader/efi_disk.c b/lib/efi_loader/efi_disk.c
index 861fcaf3747f..0792e53b32c6 100644
--- a/lib/efi_loader/efi_disk.c
+++ b/lib/efi_loader/efi_disk.c
@@ -337,6 +337,12 @@ static efi_status_t efi_disk_add_dev(
diskobj->dp);
if (ret != EFI_SUCCESS)
return ret;
+ if (!part) {
+ char buf[10];
+
+ sprintf(buf, "%d:%d", dev_index, part);
+ fs_set_blk_dev(if_typename, buf, FS_TYPE_ANY);
+ }
if (part >= 1 && efi_fs_exists(desc, part)) {
diskobj->volume = efi_simple_file_system(desc, part,
diskobj->dp);
next prev parent reply other threads:[~2019-10-23 10:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-07 5:59 [U-Boot] [PATCH v4 0/5] efi_loader: disk: install FILE_SYSTEM_PROTOCOL to whole disk AKASHI Takahiro
2019-10-07 5:59 ` [U-Boot] [PATCH v4 1/5] fs: export fs_close() AKASHI Takahiro
2019-10-12 21:24 ` Heinrich Schuchardt
2019-10-07 5:59 ` [U-Boot] [PATCH v4 2/5] fs: clean up around fs_type AKASHI Takahiro
2019-10-12 21:23 ` Heinrich Schuchardt
2019-10-07 5:59 ` [U-Boot] [PATCH v4 3/5] fs: add fs_get_type() for current filesystem type AKASHI Takahiro
2019-10-07 5:59 ` [U-Boot] [PATCH v4 4/5] efi_loader: disk: install FILE_SYSTEM_PROTOCOL only if available AKASHI Takahiro
2019-10-22 20:29 ` [U-Boot] [BUG] efi_driver: crash while reading from iSCSI drive Heinrich Schuchardt
2019-10-23 10:30 ` AKASHI Takahiro [this message]
2019-10-24 3:26 ` Heinrich Schuchardt
2019-10-07 5:59 ` [U-Boot] [PATCH v4 5/5] efi_loader: disk: install file system protocol to a whole disk AKASHI Takahiro
2019-10-12 19:43 ` Heinrich Schuchardt
2019-10-15 7:34 ` AKASHI Takahiro
2019-10-15 11:07 ` Heinrich Schuchardt
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=20191023103021.GG10448@linaro.org \
--to=takahiro.akashi@linaro.org \
--cc=u-boot@lists.denx.de \
/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