Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 348709ba authored by Artem Bityutskiy's avatar Artem Bityutskiy
Browse files

UBIFS: do not print scary error messages needlessly



At the moment UBIFS print large and scary error messages and
flash dumps in case of nearly any corruption, even if it is
a recoverable corruption. For example, if the master node is
corrupted, ubifs_scan() prints error dumps, then UBIFS recovers
just fine and goes on.

This patch makes UBIFS print scary error messages only in
real cases, which are not recoverable. It adds 'quiet' argument
to the 'ubifs_scan()' function, so the caller may ask 'ubi_scan()'
not to print error messages if the caller is able to do recovery.

Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Reviewed-by: default avatarAdrian Hunter <Adrian.Hunter@nokia.com>
parent e3c3efc2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -724,7 +724,7 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum)

	printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n",
	       current->pid, lnum);
	sleb = ubifs_scan(c, lnum, 0, c->dbg->buf);
	sleb = ubifs_scan(c, lnum, 0, c->dbg->buf, 0);
	if (IS_ERR(sleb)) {
		ubifs_err("scan error %d", (int)PTR_ERR(sleb));
		return;
+1 −1
Original line number Diff line number Diff line
@@ -529,7 +529,7 @@ int ubifs_garbage_collect_leb(struct ubifs_info *c, struct ubifs_lprops *lp)
	 * We scan the entire LEB even though we only really need to scan up to
	 * (c->leb_size - lp->free).
	 */
	sleb = ubifs_scan(c, lnum, 0, c->sbuf);
	sleb = ubifs_scan(c, lnum, 0, c->sbuf, 0);
	if (IS_ERR(sleb))
		return PTR_ERR(sleb);

+1 −1
Original line number Diff line number Diff line
@@ -695,7 +695,7 @@ int ubifs_consolidate_log(struct ubifs_info *c)
	lnum = c->ltail_lnum;
	write_lnum = lnum;
	while (1) {
		sleb = ubifs_scan(c, lnum, 0, c->sbuf);
		sleb = ubifs_scan(c, lnum, 0, c->sbuf, 0);
		if (IS_ERR(sleb)) {
			err = PTR_ERR(sleb);
			goto out_free;
+1 −1
Original line number Diff line number Diff line
@@ -1096,7 +1096,7 @@ static int scan_check_cb(struct ubifs_info *c,
		}
	}

	sleb = ubifs_scan(c, lnum, 0, c->dbg->buf);
	sleb = ubifs_scan(c, lnum, 0, c->dbg->buf, 0);
	if (IS_ERR(sleb)) {
		/*
		 * After an unclean unmount, empty and freeable LEBs
+2 −2
Original line number Diff line number Diff line
@@ -40,7 +40,7 @@ static int scan_for_master(struct ubifs_info *c)

	lnum = UBIFS_MST_LNUM;

	sleb = ubifs_scan(c, lnum, 0, c->sbuf);
	sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1);
	if (IS_ERR(sleb))
		return PTR_ERR(sleb);
	nodes_cnt = sleb->nodes_cnt;
@@ -56,7 +56,7 @@ static int scan_for_master(struct ubifs_info *c)

	lnum += 1;

	sleb = ubifs_scan(c, lnum, 0, c->sbuf);
	sleb = ubifs_scan(c, lnum, 0, c->sbuf, 1);
	if (IS_ERR(sleb))
		return PTR_ERR(sleb);
	if (sleb->nodes_cnt != nodes_cnt)
Loading