[PATCH] [JFFS2] Fix unreasonable jffs2_do_reserve_space() failure

Alexander Belyakov abelyako at googlemail.com
Tue Jul 3 10:45:07 EDT 2007


On 6/29/07, Alexander Belyakov <abelyako at googlemail.com> wrote:
>
> The patch below checks if erasable_list is empty. If so
> jffs2_refile_wbuf_blocks() moves at least one block to that list.
> jffs2_find_gc_block() will not fail in that case and write will
> succeed.
>
> Signed-off-by: Alexander Belyakov <alexander.belyakov at intel.com>
> ---
> diff -uNr a/fs/jffs2/wbuf.c b/fs/jffs2/wbuf.c
> --- a/fs/jffs2/wbuf.c   2007-05-25 01:22:47.000000000 +0400
> +++ b/fs/jffs2/wbuf.c   2007-06-20 18:45:09.000000000 +0400
> @@ -117,7 +117,7 @@
>
>                 D1(printk(KERN_DEBUG "Removing eraseblock at 0x%08x from
> erasable_pending_wbuf_list...\n", jeb->offset));
>                 list_del(this);
> -               if ((jiffies + (n++)) & 127) {
> +               if (((jiffies + (n++)) & 127) && !list_empty(&c->erasable_list)) {
>                         /* Most of the time, we just erase it immediately. Otherwise we
>                            spend ages scanning it on mount, etc. */
>                         D1(printk(KERN_DEBUG "...and adding to erase_pending_list\n"));
>

David,

what do think about fixing this bug in mainline?

Thanks,
Alexander



More information about the linux-mtd mailing list