[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Garbage collection problems.




This appears to fix it. We could potentially be slightly kinder to the 
users who don't check the return value from write(2). I'm all in favour of 
just letting them screw up though.

Index: inode-v22.c
===================================================================
RCS file: /home/cvs/mtd/fs/jffs/inode-v22.c,v
retrieving revision 1.33
diff -u -r1.33 inode-v22.c
--- inode-v22.c	2000/08/11 09:02:51	1.33
+++ inode-v22.c	2000/08/15 17:59:30
@@ -1448,6 +1448,9 @@
 
 	c = f->c;
 
+	if (count > c->fmc->max_chunk_size) 
+		count = c->fmc->max_chunk_size - sizeof(struct jffs_raw_inode);
+
 	if (!JFFS_ENOUGH_SPACE(c)) {
 		D1(printk("jffs_file_write(): Free size = %u\n",
 			  jffs_free_size1(c->fmc) + jffs_free_size2(c->fmc)));

--
dwmw2