mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Renaud Barbier <renaud.barbier@ge.com>
To: barebox@lists.infradead.org
Cc: Thomas Weber <weber@corscience.de>, Bernhard Walle <walle@corscience.de>
Subject: [PATCH 17/18] UBIFS: Improve error message when reading superblock failed
Date: Mon,  3 Dec 2012 18:08:33 +0000	[thread overview]
Message-ID: <1354558114-28799-18-git-send-email-renaud.barbier@ge.com> (raw)
In-Reply-To: <1354558114-28799-1-git-send-email-renaud.barbier@ge.com>

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>

Use priv->vol_name instead of "name".

Signed-off-by: Renaud Barbier <renaud.barbier@ge.com>
---
 fs/ubifs/super.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/ubifs/super.c b/fs/ubifs/super.c
index 118d728..a77b73a 100644
--- a/fs/ubifs/super.c
+++ b/fs/ubifs/super.c
@@ -1189,8 +1189,8 @@ int ubifs_mount(struct ubifs_priv *priv)
 	mnt = NULL;
 	ret = ubifs_get_sb(&ubifs_fs_type, flags, priv->vol_name, data, mnt);
 	if (ret) {
-		printf("Error reading superblock on volume '%s'!\n",
-				priv->vol_name);
+		ubifs_err("Error reading superblock on volume '%s' errno=%d!\n",
+				priv->vol_name, ret);
 		return -1;
 	}
 
-- 
1.7.1


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-12-03 18:09 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-03 18:08 [PATCH 00/18] UBIFS support Renaud Barbier
2012-12-03 18:08 ` [PATCH 01/18] fs/fs.c: check that fsdev->cdev->dev is not NULL Renaud Barbier
2012-12-03 18:08 ` [PATCH 02/18] UBIFS: preparation Renaud Barbier
2012-12-03 18:08 ` [PATCH 03/18] UBIFS: header files (1/2) Renaud Barbier
2012-12-03 18:08 ` [PATCH 04/18] UBIFS: header files (2/2) Renaud Barbier
2012-12-03 18:08 ` [PATCH 05/18] UBIFS: file operations Renaud Barbier
2012-12-04 22:53   ` Sascha Hauer
2012-12-03 18:08 ` [PATCH 06/18] UBIFS: initialization Renaud Barbier
2012-12-03 18:08 ` [PATCH 07/18] UBIFS: journal Renaud Barbier
2012-12-03 18:08 ` [PATCH 08/18] UBIFS: I/O subsystem Renaud Barbier
2012-12-03 18:08 ` [PATCH 09/18] UBIFS: LEB support Renaud Barbier
2012-12-03 18:08 ` [PATCH 10/18] UBIFS: master node Renaud Barbier
2012-12-03 18:08 ` [PATCH 11/18] UBIFS: recovery Renaud Barbier
2012-12-03 18:08 ` [PATCH 12/18] UBIFS: tree node cache Renaud Barbier
2012-12-03 18:08 ` [PATCH 13/18] UBIFS: superblock Renaud Barbier
2012-12-03 18:08 ` [PATCH 14/18] UBIFS: scan Renaud Barbier
2012-12-03 18:08 ` [PATCH 15/18] UBIFS: configuration and build directives Renaud Barbier
2012-12-03 18:08 ` [PATCH 16/18] ubifs bad superblock bug Renaud Barbier
2012-12-03 18:08 ` Renaud Barbier [this message]
2012-12-03 18:08 ` [PATCH 18/18] ubifs: Fix memory leak in ubifs_finddir Renaud Barbier
2012-12-03 19:17 ` [PATCH 00/18] UBIFS support Robert Jarzmik
2012-12-04 10:35   ` Renaud Barbier
2012-12-04 20:09     ` Robert Jarzmik
2012-12-05 11:47       ` Renaud Barbier

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=1354558114-28799-18-git-send-email-renaud.barbier@ge.com \
    --to=renaud.barbier@ge.com \
    --cc=barebox@lists.infradead.org \
    --cc=walle@corscience.de \
    --cc=weber@corscience.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