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

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun May 28 19:59:02 EDT 2006


Commit:     a6a8bef722875a95bb73e6de7da924a8d417b52c
Parent:     2ebf09c2491433a499e0ae7723d04e9e810afa84
Author:     David Woodhouse <dwmw2 at infradead.org>
AuthorDate: Mon May 29 00:41:11 2006 +0100
Commit:     David Woodhouse <dwmw2 at infradead.org>
CommitDate: Mon May 29 00:41:11 2006 +0100

    [JFFS2] Preallocate raw_node_refs in a couple of missing places in scan
    
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>

 fs/jffs2/scan.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 3fb0e7e..42c1ff2 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -67,8 +67,11 @@ static inline uint32_t EMPTY_SCAN_SIZE(u
 
 static int file_dirty(struct jffs2_sb_info *c, struct jffs2_eraseblock *jeb)
 {
-	int ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size);
-	if (ret)
+	int ret;
+
+	if ((ret = jffs2_prealloc_raw_node_refs(c, jeb, 1)))
+		return ret;
+	if ((ret = jffs2_scan_dirty_space(c, jeb, jeb->free_size)))
 		return ret;
 	/* Turned wasted size into dirty, since we apparently 
 	   think it's recoverable now. */
@@ -559,6 +562,8 @@ #endif
 	if (ofs) {
 		D1(printk(KERN_DEBUG "Free space at %08x ends at %08x\n", jeb->offset,
 			  jeb->offset + ofs));
+		if ((err = jffs2_prealloc_raw_node_refs(c, jeb, 1)))
+			return err;
 		if ((err = jffs2_scan_dirty_space(c, jeb, ofs)))
 			return err;
 	}



More information about the linux-mtd-cvs mailing list