diff options
Diffstat (limited to 'fs')
-rw-r--r-- | fs/ubifs/debug.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/fs/ubifs/debug.c b/fs/ubifs/debug.c index 02c10dccdd60..c2e5c08a9d30 100644 --- a/fs/ubifs/debug.c +++ b/fs/ubifs/debug.c | |||
@@ -810,16 +810,24 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum) | |||
810 | { | 810 | { |
811 | struct ubifs_scan_leb *sleb; | 811 | struct ubifs_scan_leb *sleb; |
812 | struct ubifs_scan_node *snod; | 812 | struct ubifs_scan_node *snod; |
813 | void *buf; | ||
813 | 814 | ||
814 | if (dbg_failure_mode) | 815 | if (dbg_failure_mode) |
815 | return; | 816 | return; |
816 | 817 | ||
817 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", | 818 | printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n", |
818 | current->pid, lnum); | 819 | current->pid, lnum); |
819 | sleb = ubifs_scan(c, lnum, 0, c->dbg->buf, 0); | 820 | |
821 | buf = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL); | ||
822 | if (!buf) { | ||
823 | ubifs_err("cannot allocate memory for dumping LEB %d", lnum); | ||
824 | return; | ||
825 | } | ||
826 | |||
827 | sleb = ubifs_scan(c, lnum, 0, buf, 0); | ||
820 | if (IS_ERR(sleb)) { | 828 | if (IS_ERR(sleb)) { |
821 | ubifs_err("scan error %d", (int)PTR_ERR(sleb)); | 829 | ubifs_err("scan error %d", (int)PTR_ERR(sleb)); |
822 | return; | 830 | goto out; |
823 | } | 831 | } |
824 | 832 | ||
825 | printk(KERN_DEBUG "LEB %d has %d nodes ending at %d\n", lnum, | 833 | printk(KERN_DEBUG "LEB %d has %d nodes ending at %d\n", lnum, |
@@ -835,6 +843,9 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum) | |||
835 | printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n", | 843 | printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n", |
836 | current->pid, lnum); | 844 | current->pid, lnum); |
837 | ubifs_scan_destroy(sleb); | 845 | ubifs_scan_destroy(sleb); |
846 | |||
847 | out: | ||
848 | vfree(buf); | ||
838 | return; | 849 | return; |
839 | } | 850 | } |
840 | 851 | ||