From: Artem Bityutskiy Date: Sun, 24 Apr 2011 07:53:17 +0000 (+0300) Subject: UBIFS: fix oops in lprops dump function X-Git-Tag: upstream/snapshot3+hdmi~10326^2~39 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1321657d8f843641529eff26e25722158cc29349;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git UBIFS: fix oops in lprops dump function The 'dbg_dump_lprop()' is trying to detect journal head LEBs when printing, so it looks at the write-buffers. However, if we are in R/O mode, we de-allocate the write-buffers, so 'dbg_dump_lprop()' oopses. This patch fixes the issue. Note, this patch is not critical, it is only about the debugging code path, and it is unlikely that anyone but UBIFS developers would ever hit this issue. Signed-off-by: Artem Bityutskiy --- diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index ba4d795..4062ec6 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c @@ -746,7 +746,13 @@ void dbg_dump_lprop(const struct ubifs_info *c, const struct ubifs_lprops *lp) if (bud->lnum == lp->lnum) { int head = 0; for (i = 0; i < c->jhead_cnt; i++) { - if (lp->lnum == c->jheads[i].wbuf.lnum) { + /* + * Note, if we are in R/O mode or in the middle + * of mounting/re-mounting, the write-buffers do + * not exist. + */ + if (c->jheads && + lp->lnum == c->jheads[i].wbuf.lnum) { printk(KERN_CONT ", jhead %s", dbg_jhead(i)); head = 1;