mtd/fs/jffs2 gc.c,1.112,1.113

David Woodhouse dwmw2 at infradead.org
Wed Oct 8 21:17:40 EDT 2003


Update of /home/cvs/mtd/fs/jffs2
In directory phoenix.infradead.org:/tmp/cvs-serv475

Modified Files:
	gc.c 
Log Message:
Fix hole case.


Index: gc.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs2/gc.c,v
retrieving revision 1.112
retrieving revision 1.113
diff -u -r1.112 -r1.113
--- gc.c	9 Oct 2003 01:12:53 -0000	1.112
+++ gc.c	9 Oct 2003 01:17:38 -0000	1.113
@@ -1039,7 +1039,7 @@
 {
 	struct jffs2_full_dnode *new_fn;
 	struct jffs2_raw_inode ri;
-	uint32_t alloclen, phys_ofs, offset, orig_end;	
+	uint32_t alloclen, phys_ofs, offset, orig_end, orig_start;	
 	int ret = 0;
 	unsigned char *comprbuf = NULL, *writebuf;
 	struct page *pg;
@@ -1052,6 +1052,7 @@
 		  f->inocache->ino, start, end));
 
 	orig_end = end;
+	orig_start = start;
 
 	if (c->nr_free_blocks + c->nr_erasing_blocks > c->resv_blocks_gcmerge) {
 		/* Attempt to do some merging. But only expand to cover logically
@@ -1063,7 +1064,7 @@
 
 		struct jffs2_node_frag *frag;
 		uint32_t min, max;
-#error this code is tested and will eat your filesystem
+
 		min = start & ~(PAGE_CACHE_SIZE-1);
 		max = min + PAGE_CACHE_SIZE;
 
@@ -1170,11 +1171,11 @@
 			}
 		}
 		D1(printk("Expanded dnode to write from (0x%x-0x%x) to (0x%x-0x%x)\n", 
-			  fn->ofs, orig_end, start, end));
+			  orig_start, orig_end, start, end));
 
 		BUG_ON(end > JFFS2_F_I_SIZE(f));
 		BUG_ON(end < orig_end);
-		BUG_ON(start > fn->ofs);
+		BUG_ON(start > orig_start);
 	}
 	
 	/* First, use readpage() to read the appropriate page into the page cache */




More information about the linux-mtd-cvs mailing list