JFFS2 list_dirty corruption

Thomas Gleixner gleixner at autronix.de
Wed Feb 20 15:10:15 EST 2002


On Wednesday, 20. February 2002 20:41, Thomas Gleixner wrote:
> While hacking on JFFS2 for NAND I found a possibility, where scan_medium
> corrupts list_dirty.
This patch resolves the problem:

--- org/fs/jffs2/scan.c
+++ work/fs/jffs2/scan.c
@@ -128,9 +128,15 @@
                                 (!c->nextblock || c->nextblock->free_size < 
jeb->free_size)) {
                                 /* Better candidate for the next writes to 
go to */
                                 if (c->nextblock)
+					/* We must delete, because mark_node_obsolete
+					   could have added this block to dirty_list already */
+                                        list_del(&c->nextblock->list);
                                         list_add(&c->nextblock->list, 
&c->dirty_list);
                                 c->nextblock = jeb;
                         } else {
+				/* We must delete, because mark_node_obsolete
+				   could have added this block to dirty_list already */
+				list_del(&jeb->list); 
                                 list_add(&jeb->list, &c->dirty_list);
                         }
 		} else {

I put it into CVS too
-- 
Thomas
__________________________________________________
Thomas Gleixner, autronix automation GmbH
auf dem berg 3, d-88690 uhldingen-muehlhofen
fon: +49 7556 919891 , fax: +49 7556 919886
mail: gleixner at autronix.de, http://www.autronix.de  




More information about the linux-mtd mailing list