Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[JFFS2] Preallocate raw_node_refs in a couple of missing places in scan

Signed-off-by: David Woodhouse <dwmw2@infradead.org>

+7 -2
+7 -2
fs/jffs2/scan.c
··· 67 67 68 68 static int file_dirty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb) 69 69 { 70 - int ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size); 71 - if (ret) 70 + int ret; 71 + 72 + if ((ret = jffs2_prealloc_raw_node_refs(c, jeb, 1))) 73 + return ret; 74 + if ((ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size))) 72 75 return ret; 73 76 /* Turned wasted size into dirty, since we apparently 74 77 think it's recoverable now. */ ··· 562 559 if (ofs) { 563 560 D1(printk(KERN_DEBUG "Free space at %08x ends at %08x\n", jeb->offset, 564 561 jeb->offset + ofs)); 562 + if ((err = jffs2_prealloc_raw_node_refs(c, jeb, 1))) 563 + return err; 565 564 if ((err = jffs2_scan_dirty_space(c, jeb, ofs))) 566 565 return err; 567 566 }