aboutsummaryrefslogtreecommitdiffstats
path: root/fs/ubifs/debug.c
diff options
context:
space:
mode:
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-04-24 03:53:17 -0400
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>2011-05-13 12:23:55 -0400
commit1321657d8f843641529eff26e25722158cc29349 (patch)
treed3d0ad3cc1f8074f4ffb3a4700e63f0a15ee35c6 /fs/ubifs/debug.c
parent3b2f9a019e655f3407e4e69cdbaf8b75699b79a4 (diff)
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 <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'fs/ubifs/debug.c')
-rw-r--r--fs/ubifs/debug.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c
index ba4d795d63a3..4062ec602632 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)
746 if (bud->lnum == lp->lnum) { 746 if (bud->lnum == lp->lnum) {
747 int head = 0; 747 int head = 0;
748 for (i = 0; i < c->jhead_cnt; i++) { 748 for (i = 0; i < c->jhead_cnt; i++) {
749 if (lp->lnum == c->jheads[i].wbuf.lnum) { 749 /*
750 * Note, if we are in R/O mode or in the middle
751 * of mounting/re-mounting, the write-buffers do
752 * not exist.
753 */
754 if (c->jheads &&
755 lp->lnum == c->jheads[i].wbuf.lnum) {
750 printk(KERN_CONT ", jhead %s", 756 printk(KERN_CONT ", jhead %s",
751 dbg_jhead(i)); 757 dbg_jhead(i));
752 head = 1; 758 head = 1;