mtd/fs/jffs2 nodemgmt.c,1.114,1.115
David Woodhouse
dwmw2 at infradead.org
Mon Nov 22 06:07:24 EST 2004
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv17679
Modified Files:
nodemgmt.c
Log Message:
Fix another bug in the merging of obsolete nodes
Index: nodemgmt.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodemgmt.c,v
retrieving revision 1.114
retrieving revision 1.115
diff -u -r1.114 -r1.115
--- nodemgmt.c 20 Nov 2004 16:39:59 -0000 1.114
+++ nodemgmt.c 22 Nov 2004 11:07:21 -0000 1.115
@@ -601,8 +601,9 @@
/* Merge with the next node in the physical list, if there is one
- and if it's also obsolete. */
- if (ref->next_phys && ref_obsolete(ref->next_phys) ) {
+ and if it's also obsolete and if it doesn't belong to any inode */
+ if (ref->next_phys && ref_obsolete(ref->next_phys) &&
+ !ref->next_phys->next_in_ino) {
struct jffs2_raw_node_ref *n = ref->next_phys;
spin_lock(&c->erase_completion_lock);
@@ -616,7 +617,6 @@
}
spin_unlock(&c->erase_completion_lock);
- BUG_ON(n->next_in_ino);
jffs2_free_raw_node_ref(n);
}
@@ -630,7 +630,7 @@
while (p->next_phys != ref)
p = p->next_phys;
- if (ref_obsolete(p) ) {
+ if (ref_obsolete(p) && !ref->next_in_ino) {
p->__totlen += ref->__totlen;
if (jeb->last_node == ref) {
jeb->last_node = p;
More information about the linux-mtd-cvs
mailing list