From patchwork Mon Jun 6 19:52:06 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: ubifs_decompress: cannot decompress ... Date: Mon, 06 Jun 2011 09:52:06 -0000 From: "Matthew L. Creech" X-Patchwork-Id: 99019 Message-Id: <1307389926-12209-1-git-send-email-mlcreech@gmail.com> To: linux-mtd@lists.infradead.org Cc: dedekind1@gmail.com On Mon, Jun 6, 2011 at 12:18 PM, Artem Bityutskiy wrote: > > I have to go home now - could you please improve dbg_dump_leb(). > Currently it calls ubifs_scan(), which scans, finds corrupted node, > prints corruption information and returns -EUCLEAN and destroys the > scanned data. > Will something like this be okay? Or do you still want to dump the partially-parsed data from the corrupt node as well (not just the raw contents of the LEB)? Currently an error in ubifs_scan() will cause dbg_dump_leb() to abort without completing the dump. Instead, we should abandon parsing the data, but dump the raw (uninterpreted) LEB contents instead. Signed-off-by: Matthew L. Creech --- fs/ubifs/debug.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 26d4c61..6ab43e4 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -901,6 +901,9 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum) sleb = ubifs_scan(c, lnum, 0, buf, 0); if (IS_ERR(sleb)) { ubifs_err("scan error %d", (int)PTR_ERR(sleb)); + printk(KERN_DEBUG "\tLEB data buffer:\n"); + print_hex_dump(KERN_DEBUG, "\t", DUMP_PREFIX_OFFSET, 32, 1, + buf, c->leb_size, 0); goto out; }