From: Artem Bityutskiy <dedekind1@gmail.com>
To: linux-mtd@lists.infradead.org
Subject: [PATCH 17/30] UBIFS: be more informative in failure mode
Date: Thu, 9 Jun 2011 12:04:57 +0300 [thread overview]
Message-ID: <1307610310-28691-18-git-send-email-dedekind1@gmail.com> (raw)
In-Reply-To: <1307610310-28691-1-git-send-email-dedekind1@gmail.com>
From: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
When we are testing UBIFS recovery, it is better to print in which eraseblock
we are going to fail. Currently UBIFS prints it only if recovery debugging
messages are enabled, but this is not very practical. So change 'dbg_rcvry()'
messages to 'ubifs_warn()' messages.
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
---
fs/ubifs/debug.c | 26 +++++++++++++-------------
1 files changed, 13 insertions(+), 13 deletions(-)
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index fdfa5de..05fae3f 100644
--- a/fs/ubifs/debug.c
+++ b/fs/ubifs/debug.c
@@ -2631,11 +2631,11 @@ static int do_fail(struct ubi_volume_desc *desc, int lnum, int write)
d->fail_delay = 1;
d->fail_timeout = jiffies +
msecs_to_jiffies(delay);
- dbg_rcvry("failing after %ums", delay);
+ ubifs_warn("failing after %ums", delay);
} else {
d->fail_delay = 2;
d->fail_cnt_max = delay;
- dbg_rcvry("failing after %u calls", delay);
+ ubifs_warn("failing after %u calls", delay);
}
}
d->fail_cnt += 1;
@@ -2653,56 +2653,56 @@ static int do_fail(struct ubi_volume_desc *desc, int lnum, int write)
return 0;
} else if (chance(19, 20))
return 0;
- dbg_rcvry("failing in super block LEB %d", lnum);
+ ubifs_warn("failing in super block LEB %d", lnum);
} else if (lnum == UBIFS_MST_LNUM || lnum == UBIFS_MST_LNUM + 1) {
if (chance(19, 20))
return 0;
- dbg_rcvry("failing in master LEB %d", lnum);
+ ubifs_warn("failing in master LEB %d", lnum);
} else if (lnum >= UBIFS_LOG_LNUM && lnum <= c->log_last) {
if (write) {
if (chance(99, 100))
return 0;
} else if (chance(399, 400))
return 0;
- dbg_rcvry("failing in log LEB %d", lnum);
+ ubifs_warn("failing in log LEB %d", lnum);
} else if (lnum >= c->lpt_first && lnum <= c->lpt_last) {
if (write) {
if (chance(7, 8))
return 0;
} else if (chance(19, 20))
return 0;
- dbg_rcvry("failing in LPT LEB %d", lnum);
+ ubifs_warn("failing in LPT LEB %d", lnum);
} else if (lnum >= c->orph_first && lnum <= c->orph_last) {
if (write) {
if (chance(1, 2))
return 0;
} else if (chance(9, 10))
return 0;
- dbg_rcvry("failing in orphan LEB %d", lnum);
+ ubifs_warn("failing in orphan LEB %d", lnum);
} else if (lnum == c->ihead_lnum) {
if (chance(99, 100))
return 0;
- dbg_rcvry("failing in index head LEB %d", lnum);
+ ubifs_warn("failing in index head LEB %d", lnum);
} else if (c->jheads && lnum == c->jheads[GCHD].wbuf.lnum) {
if (chance(9, 10))
return 0;
- dbg_rcvry("failing in GC head LEB %d", lnum);
+ ubifs_warn("failing in GC head LEB %d", lnum);
} else if (write && !RB_EMPTY_ROOT(&c->buds) &&
!ubifs_search_bud(c, lnum)) {
if (chance(19, 20))
return 0;
- dbg_rcvry("failing in non-bud LEB %d", lnum);
+ ubifs_warn("failing in non-bud LEB %d", lnum);
} else if (c->cmt_state == COMMIT_RUNNING_BACKGROUND ||
c->cmt_state == COMMIT_RUNNING_REQUIRED) {
if (chance(999, 1000))
return 0;
- dbg_rcvry("failing in bud LEB %d commit running", lnum);
+ ubifs_warn("failing in bud LEB %d commit running", lnum);
} else {
if (chance(9999, 10000))
return 0;
- dbg_rcvry("failing in bud LEB %d commit not running", lnum);
+ ubifs_warn("failing in bud LEB %d commit not running", lnum);
}
- ubifs_err("*** SETTING FAILURE MODE ON (LEB %d) ***", lnum);
+
d->failure_mode = 1;
dump_stack();
return 1;
--
1.7.2.3
next prev parent reply other threads:[~2011-06-09 9:01 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-06-09 9:04 [PATCH 00/30] UBIFS: latest patches Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 01/30] UBIFS: return EROFS in case of broken commit Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 02/30] UBIFS: lessen the size of debugging info data structure Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 03/30] UBIFS: dump stack when pnode or nnode reading fails Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 04/30] UBIFS: improve inode dumping function Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 05/30] UBIFS: rename dbg_check_dir_size function Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 06/30] UBIFS: minor cleanup: use S_ISREG helper Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 07/30] UBIFS: remove unnecessary brackets Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 08/30] UBIFS: remove dead code Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 09/30] UBIFS: harmonize znode flag helpers Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 10/30] UBIFS: use correct flags in lprops Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 11/30] UBIFS: add few commentaries about TNC Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 12/30] UBIFS: amend debugging name check function prototype Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 13/30] UBIFS: amend debugging inode size " Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 14/30] UBIFS: introduce helper functions for debugging checks and tests Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 15/30] UBIFS: lessen amount of debugging check types Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 16/30] UBIFS: switch self-check knobs to debugfs Artem Bityutskiy
2011-06-09 9:04 ` Artem Bityutskiy [this message]
2011-06-09 9:04 ` [PATCH 18/30] UBIFS: re-arrange debugging code a bit Artem Bityutskiy
2011-06-09 9:04 ` [PATCH 19/30] UBIFS: introduce debugfs helpers Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 20/30] UBIFS: add global debugfs knobs Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 21/30] UBIFS: remove unused and unneeded debugging function Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 22/30] UBIFS: always print stacktrace when switching to R/O mode Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 23/30] UBIFS: introduce more I/O helpers Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 24/30] UBIFS: switch to ubifs_leb_read Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 25/30] UBIFS: switch to ubifs_leb_write Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 26/30] UBIFS: switch to I/O helpers Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 27/30] UBIFS: stop re-defining UBI operations Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 28/30] UBIFS: remove custom list of superblocks Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 29/30] UBIFS: rename recovery testing variables Artem Bityutskiy
2011-06-09 9:05 ` [PATCH 30/30] UBIFS: improve power cut emulation testing Artem Bityutskiy
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=1307610310-28691-18-git-send-email-dedekind1@gmail.com \
--to=dedekind1@gmail.com \
--cc=linux-mtd@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;
as well as URLs for NNTP newsgroup(s).