|
@@ -810,16 +810,24 @@ void dbg_dump_leb(const struct ubifs_info *c, int lnum)
|
|
{
|
|
{
|
|
struct ubifs_scan_leb *sleb;
|
|
struct ubifs_scan_leb *sleb;
|
|
struct ubifs_scan_node *snod;
|
|
struct ubifs_scan_node *snod;
|
|
|
|
+ void *buf;
|
|
|
|
|
|
if (dbg_failure_mode)
|
|
if (dbg_failure_mode)
|
|
return;
|
|
return;
|
|
|
|
|
|
printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n",
|
|
printk(KERN_DEBUG "(pid %d) start dumping LEB %d\n",
|
|
current->pid, lnum);
|
|
current->pid, lnum);
|
|
- sleb = ubifs_scan(c, lnum, 0, c->dbg->buf, 0);
|
|
|
|
|
|
+
|
|
|
|
+ buf = __vmalloc(c->leb_size, GFP_KERNEL | GFP_NOFS, PAGE_KERNEL);
|
|
|
|
+ if (!buf) {
|
|
|
|
+ ubifs_err("cannot allocate memory for dumping LEB %d", lnum);
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ sleb = ubifs_scan(c, lnum, 0, buf, 0);
|
|
if (IS_ERR(sleb)) {
|
|
if (IS_ERR(sleb)) {
|
|
ubifs_err("scan error %d", (int)PTR_ERR(sleb));
|
|
ubifs_err("scan error %d", (int)PTR_ERR(sleb));
|
|
- return;
|
|
|
|
|
|
+ goto out;
|
|
}
|
|
}
|
|
|
|
|
|
printk(KERN_DEBUG "LEB %d has %d nodes ending at %d\n", lnum,
|
|
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)
|
|
printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n",
|
|
printk(KERN_DEBUG "(pid %d) finish dumping LEB %d\n",
|
|
current->pid, lnum);
|
|
current->pid, lnum);
|
|
ubifs_scan_destroy(sleb);
|
|
ubifs_scan_destroy(sleb);
|
|
|
|
+
|
|
|
|
+out:
|
|
|
|
+ vfree(buf);
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
|