* [PATCH 1/1] spl: fix ext4fs_mount return code handling
@ 2020-06-16 11:59 Heiko Thiery
2020-06-16 15:29 ` Tom Rini
0 siblings, 1 reply; 3+ messages in thread
From: Heiko Thiery @ 2020-06-16 11:59 UTC (permalink / raw)
To: u-boot
From: Thomas Schaefer <thomas.schaefer@kontron.com>
- Despite other ext4 filesystem functions, ext4fs_mount returns
0 in case of error.
- This leads to u-boot crash in case that an SD card
with valid partition table but without ext4 filesystem created
in a partition is found on SD card.
- Fix this by returning a proper error code of '-1' from spl_load_image_ext
function in case of ext4fs_mount error.
Signed-off-by: Thomas Schaefer <thomas.schaefer@kontron.com>
[hthiery: slightly reword the commit message]
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
common/spl/spl_ext.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 3898041d10..c8d137ed98 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -32,6 +32,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: ext4fs mount err - %d\n", __func__, err);
#endif
+ err = -1; /* ext4fs_mount returns 0 in case of error! */
goto end;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 1/1] spl: fix ext4fs_mount return code handling
2020-06-16 11:59 [PATCH 1/1] spl: fix ext4fs_mount return code handling Heiko Thiery
@ 2020-06-16 15:29 ` Tom Rini
0 siblings, 0 replies; 3+ messages in thread
From: Tom Rini @ 2020-06-16 15:29 UTC (permalink / raw)
To: u-boot
On Tue, Jun 16, 2020 at 01:59:03PM +0200, Heiko Thiery wrote:
> From: Thomas Schaefer <thomas.schaefer@kontron.com>
>
> - Despite other ext4 filesystem functions, ext4fs_mount returns
> 0 in case of error.
> - This leads to u-boot crash in case that an SD card
> with valid partition table but without ext4 filesystem created
> in a partition is found on SD card.
> - Fix this by returning a proper error code of '-1' from spl_load_image_ext
> function in case of ext4fs_mount error.
>
> Signed-off-by: Thomas Schaefer <thomas.schaefer@kontron.com>
> [hthiery: slightly reword the commit message]
> Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
> ---
> common/spl/spl_ext.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
> index 3898041d10..c8d137ed98 100644
> --- a/common/spl/spl_ext.c
> +++ b/common/spl/spl_ext.c
> @@ -32,6 +32,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
> #ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
> printf("%s: ext4fs mount err - %d\n", __func__, err);
> #endif
> + err = -1; /* ext4fs_mount returns 0 in case of error! */
> goto end;
> }
Looking over the code, we should return -1 directly here, goto end isn't
going to provide more useful information as we don't have a "real" error
code to tell the user. With that change please add:
Reviewed-by: Tom Rini <trini@konsulko.com>
and post v2, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200616/6eac488f/attachment.sig>
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 1/1] spl: fix ext4fs_mount return code handling
@ 2020-06-16 9:45 Heiko Thiery
0 siblings, 0 replies; 3+ messages in thread
From: Heiko Thiery @ 2020-06-16 9:45 UTC (permalink / raw)
To: u-boot
From: Thomas Schaefer <thomas.schaefer@kontron.com>
- Despite other ext4 filesystem functions, ext4fs_mount returns
0 in case of error.
- This leads to u-boot crash in case that an SD card
with valid partition table but without ext4 filesystem created
in a partition is found on SD card.
- Fix this by returning a proper error code of '-1' from spl_load_image_ext
function in case of ext4fs_mount error.
Signed-off-by: Thomas Schaefer <thomas.schaefer@kontron.com>
[hthiery: slightly reword the commit message]
Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
---
common/spl/spl_ext.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/common/spl/spl_ext.c b/common/spl/spl_ext.c
index 3898041d10..c8d137ed98 100644
--- a/common/spl/spl_ext.c
+++ b/common/spl/spl_ext.c
@@ -32,6 +32,7 @@ int spl_load_image_ext(struct spl_image_info *spl_image,
#ifdef CONFIG_SPL_LIBCOMMON_SUPPORT
printf("%s: ext4fs mount err - %d\n", __func__, err);
#endif
+ err = -1; /* ext4fs_mount returns 0 in case of error! */
goto end;
}
--
2.20.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-06-16 15:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-16 11:59 [PATCH 1/1] spl: fix ext4fs_mount return code handling Heiko Thiery
2020-06-16 15:29 ` Tom Rini
-- strict thread matches above, loose matches on Subject: below --
2020-06-16 9:45 Heiko Thiery
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.