mtd/fs/jffs2 nodemgmt.c,1.115,1.116
hammache at infradead.org
hammache at infradead.org
Mon Jan 24 16:30:25 EST 2005
Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv25879/mtd/fs/jffs2
Modified Files:
nodemgmt.c
Log Message:
- JFFS2 and NAND failure:
avoid segfault when nextblock was refiled because of a write failure
- avoid filing blocks on the clean list when they have wasted
space
Index: nodemgmt.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/nodemgmt.c,v
retrieving revision 1.115
retrieving revision 1.116
diff -u -r1.115 -r1.116
--- nodemgmt.c 22 Nov 2004 11:07:21 -0000 1.115
+++ nodemgmt.c 24 Jan 2005 21:30:22 -0000 1.116
@@ -308,7 +308,10 @@
D1(printk(KERN_DEBUG "jffs2_add_physical_node_ref(): Node at 0x%x(%d), size 0x%x\n", ref_offset(new), ref_flags(new), len));
#if 1
- if (jeb != c->nextblock || (ref_offset(new)) != jeb->offset + (c->sector_size - jeb->free_size)) {
+ /* we could get some obsolete nodes after nextblock was refiled
+ in wbuf.c */
+ if ( (c->nextblock || !ref_obsolete(new))
+ &&(jeb != c->nextblock || (ref_offset(new)) != jeb->offset + (c->sector_size - jeb->free_size))) {
printk(KERN_WARNING "argh. node added in wrong place\n");
jffs2_free_raw_node_ref(new);
return -EINVAL;
@@ -332,7 +335,7 @@
c->used_size += len;
}
- if (!jeb->free_size && !jeb->dirty_size) {
+ if (!jeb->free_size && !jeb->dirty_size && !jeb->wasted_size) {
/* If it lives on the dirty_list, jffs2_reserve_space will put it there */
D1(printk(KERN_DEBUG "Adding full erase block at 0x%08x to clean_list (free 0x%08x, dirty 0x%08x, used 0x%08x\n",
jeb->offset, jeb->free_size, jeb->dirty_size, jeb->used_size));
More information about the linux-mtd-cvs
mailing list