Re: block in clean list with wasted space
Estelle HAMMACHE <[email protected]> Mon, 27 Sep 2004 15:36:00 +0200
| Newsgroups | gmane.linux.file-systems.jffs |
|---|---|
| Message-ID | <[email protected]> |
Merely checking wasted_size seems to do the trick.
Here is the patch, which also includes my other modification of
nodemgmt.c for NAND Flash : flush the wbuf when GC fails
because all blocks are in erasable_pending_wbuf_list
(which I am unsure about regarding which locks are needed in
a multi-tasking environment)
BTW could anyone tell me that you _have_ received this message ?
I feel like I'm talking to myself here.
bye
Estelle
--- nodemgmt.c ($Id: nodemgmt.c,v 1.107 2003/11/26 15:30:58 dwmw2 Exp $)
+++ nodemgmt.c (my version)
@@ -118,7 +118,15 @@
ret = jffs2_garbage_collect_pass(c);
if (ret)
- return ret;
+ {
+ if ((ret == -EIO) && !list_empty(&c->erasable_pending_wbuf_list))
+ {
+ D1(printk(KERN_DEBUG "jffs2: Flushing write buffer instead of garbage collect\n"));
+ jffs2_flush_wbuf_pad(c);
+ }
+ else
+ return ret;
+ }
cond_resched();
@@ -332,7 +340,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));
--------------------------------------------------------------------------
> I end up with blocks in the clean_list which have large
> amounts of wasted space, when the last write to a block
> fills up the free space exactly.
To unsubscribe from this list: send the line "unsubscribe jffs-dev" in
the body of a message to [email protected]