public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [BUGFIX] JFFS2 NOR problem
@ 2005-02-26 19:19 Artem B. Bityuckiy
  2005-02-27  9:40 ` David Woodhouse
  0 siblings, 1 reply; 7+ messages in thread
From: Artem B. Bityuckiy @ 2005-02-26 19:19 UTC (permalink / raw)
  To: linux-mtd

Hello,

I've detected major JFFS2 bug and have attached the fix. The bug seems
to be NOR-only. I believe everybody who uses JFFS2 on top of NOR flash
should have this bug fixed.

The brief problem description:

JFFS2 clears the JFFS2_SB_FLAG_MOUNTING (c-flags) superblock flag after
it has done the 1st filesystem build pass. But it still has non NULL
ic->scan_dents pointers which are actually assigned NULL at the very end
of the file system build procedure. Next FS build passes call the
jffs2_mark_node_obsolete() function which, in turn, utilizes the
jffs2_raw_ref_to_ic() function which *requires* ic->scan_dents = NULL.

This might cause infinite loops and oopses.

I think it is safe to clear the JFFS2_SB_FLAG_MOUNTING flag at the end
of JFFS2 filesystem build routine. Comments?

P.S. Possibly, the patch will fix Konstantin Kletschke's and Craig A.
Vanderborgh's problems. Guys, please try.



--- build.c     2005-02-26 22:08:17.503657749 +0300
+++ build.c_fixed       2005-02-26 22:07:55.806278357 +0300
@@ -116,7 +116,6 @@
                        cond_resched();
                }
        }
-       c->flags &= ~JFFS2_SB_FLAG_MOUNTING;

        D1(printk(KERN_DEBUG "Pass 1 complete\n"));

@@ -164,6 +163,8 @@
                ic->scan_dents = NULL;
                cond_resched();
        }
+       c->flags &= ~JFFS2_SB_FLAG_MOUNTING;
+
        D1(printk(KERN_DEBUG "Pass 3 complete\n"));
        D2(jffs2_dump_block_lists(c));


-- 
Best Regards,
Artem B. Bityuckiy,
St.-Petersburg, Russia.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2005-02-27 22:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1109444967.4688.19.camel@sauron.oktetlabs.ru>
2005-02-27  3:43 ` [BUGFIX] JFFS2 NOR problem Craig A. Vanderborgh
2005-02-27 11:26   ` Artem B. Bityuckiy
2005-02-27 18:10   ` Ray Lehtiniemi
2005-02-27 18:31     ` Artem B. Bityuckiy
2005-02-27 22:44       ` Ray Lehtiniemi
2005-02-26 19:19 Artem B. Bityuckiy
2005-02-27  9:40 ` David Woodhouse

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox