Patchwork [U-Boot] UBIFS: Improve error message when reading superblock failed

login
register
mail settings
Submitter Thomas Weber
Date April 2, 2012, 11:58 a.m.
Message ID <1333367914-20461-1-git-send-email-weber@corscience.de>
Download mbox | patch
Permalink /patch/150122/
State Accepted
Commit f75325e1927398f7e18e15f186b1fc52174cc19f
Headers show

Comments

Thomas Weber - April 2, 2012, 11:58 a.m.
From: Bernhard Walle <walle@corscience.de>

In addition to the error message also display the error code. I had the
problem that my malloc memory was not enough (ENOMEM), and if u-boot
had displayed the error code immediately that would have saved me some
debugging.

Signed-off-by: Bernhard Walle <walle@corscience.de>

Use ubifs_err instead of printf.
Add "errno=%d" in output as suggested by Albert Aribaud.
Signed-off-by: Thomas Weber <weber@corscience.de>
---
 fs/ubifs/super.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
Thomas Weber - May 15, 2012, 8:33 p.m.
Ccing Albert

Thomas

On 04/02/2012 01:58 PM, Thomas Weber wrote:
> From: Bernhard Walle <walle@corscience.de>
>
> In addition to the error message also display the error code. I had the
> problem that my malloc memory was not enough (ENOMEM), and if u-boot
> had displayed the error code immediately that would have saved me some
> debugging.
>
> Signed-off-by: Bernhard Walle <walle@corscience.de>
>
> Use ubifs_err instead of printf.
> Add "errno=%d" in output as suggested by Albert Aribaud.
> Signed-off-by: Thomas Weber <weber@corscience.de>
> ---
>  fs/ubifs/super.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
> index 26b48f0..30ccd98 100644
> --- a/fs/ubifs/super.c
> +++ b/fs/ubifs/super.c
> @@ -1191,7 +1191,7 @@ int ubifs_mount(char *vol_name)
>  	mnt = NULL;
>  	ret = ubifs_get_sb(&ubifs_fs_type, flags, name, data, mnt);
>  	if (ret) {
> -		printf("Error reading superblock on volume '%s'!\n", name);
> +		ubifs_err("Error reading superblock on volume '%s' errno=%d!\n", name, ret);
>  		return -1;
>  	}
>
Wolfgang Denk - Aug. 9, 2012, 8:12 p.m.
Dear Thomas Weber,

In message <1333367914-20461-1-git-send-email-weber@corscience.de> you wrote:
> From: Bernhard Walle <walle@corscience.de>
> 
> In addition to the error message also display the error code. I had the
> problem that my malloc memory was not enough (ENOMEM), and if u-boot
> had displayed the error code immediately that would have saved me some
> debugging.
> 
> Signed-off-by: Bernhard Walle <walle@corscience.de>
> 
> Use ubifs_err instead of printf.
> Add "errno=%d" in output as suggested by Albert Aribaud.
> Signed-off-by: Thomas Weber <weber@corscience.de>
> ---
>  fs/ubifs/super.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)

Applied, thanks.

Stefan, I hope this is OK with you.

Best regards,

Wolfgang Denk

Patch

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 26b48f0..30ccd98 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1191,7 +1191,7 @@  int ubifs_mount(char *vol_name)
 	mnt = NULL;
 	ret = ubifs_get_sb(&ubifs_fs_type, flags, name, data, mnt);
 	if (ret) {
-		printf("Error reading superblock on volume '%s'!\n", name);
+		ubifs_err("Error reading superblock on volume '%s' errno=%d!\n", name, ret);
 		return -1;
 	}