[PATCH][JFFS2] Fix garbage collector block search

Alexander Belyakov abelyako at googlemail.com
Wed Apr 23 09:08:33 EDT 2008


On Wed, Apr 23, 2008 at 3:32 PM, David Woodhouse <dwmw2 at infradead.org> wrote:
>
>  I'm playing with it now, with the intent of committing it. Can you show
>  me how to reproduce the problem?
>

The most easy way to reproduce it is to fill jffs2 volume with single
large file until there is no empty space, then remove this file and
immediately try to write another file.

Something like:
---
#!/bin/sh
rm -rf /mnt/vol1/*
dd if=/dev/urandom of=/mnt/vol1/test.file bs=4096 count=32768
rm /mnt/vol1/test.file
dd if=/dev/urandom of=/mnt/vol1/test_new.file bs=2048 count=1024
-------

The bug is better reproduced on small volumes (for me it is just
4Mbytes). The first dd should exit with "No space left on device"
error to be sure no free space left. The last dd should always
succeed. If it fails - you catch the bug. Sometimes it is necessary to
run this script in several time in a row before last dd exits with an
error.

Thanks,
Alexander



More information about the linux-mtd mailing list