[PATCH][JFFS2] Fix garbage collector block search

Alexander Belyakov abelyako at mail.ru
Wed Dec 12 10:51:28 EST 2007


Hello,

The patch checks if erasable_list is empty in jffs2_refile_wbuf_blocks() moving at least one block to that list. So jffs2_find_gc_block() will not fail sometimes with "jffs2: No clean, dirty _or_ erasable blocks to GC from! Where are they all?" message.

Signed-off-by: Alexander Belyakov <alexander.belyakov at intel.com>

diff -uNr a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
--- a/fs/jffs2/wbuf.c	2007-12-03 17:00:16.000000000 +0300
+++ b/fs/jffs2/wbuf.c	2007-12-11 19:03:03.000000000 +0300
@@ -115,7 +115,7 @@
 
 		D1(printk(KERN_DEBUG "Removing eraseblock at 0x%08x from erasable_pending_wbuf_list...\n", jeb->offset));
 		list_del(this);
-		if ((jiffies + (n++)) & 127) {
+		if (((jiffies + (n++)) & 127) && !list_empty(&c->erasable_list)) {
 			/* Most of the time, we just erase it immediately. Otherwise we
 			   spend ages scanning it on mount, etc. */
 			D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n"));




More information about the linux-mtd mailing list