JFFS2 list_dirty corruption

Adam Wozniak adam.wozniak at comdev.cc
Wed Feb 20 18:58:53 EST 2002


Ok, maybe this is a problem:


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)

UMMM open { here?

> +                                       /* We must delete, because mark_node_obsolete
> +                                          could have added this block to dirty_list already */
> +                                        list_del(&c->nextblock->list);

and close } here?

>                                          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 {


-- 
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