JFFS2 list_dirty corruption

Adam Wozniak adam.wozniak at comdev.cc
Wed Feb 20 18:55:17 EST 2002


Thomas Gleixner wrote:
> 
> 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

Ummm.  Applying that patch gives me a seg fault on boot.

--Adam
-- 
Adam Wozniak (KG6GZR)   COM DEV Wireless - Digital and Software Systems
awozniak at comdev.cc      805 Aerovista Place, San Luis Obispo, CA 93401
                        http://www.comdev.cc
                        Voice: (805) 544-1089       Fax: (805) 544-2055




More information about the linux-mtd mailing list