* padding in mkfs.jffs2 and nandwrite
@ 2005-12-14 15:37 Johannes Stezenbach
2005-12-16 17:26 ` Johannes Stezenbach
0 siblings, 1 reply; 2+ messages in thread
From: Johannes Stezenbach @ 2005-12-14 15:37 UTC (permalink / raw)
To: linux-mtd
Hi,
I've prepared a jffs2 image with mkfs.jffs2 and written it to
NAND flash using nandwrite (details below). When the file system
is mounted r/w and written to, on future mounts the following
warning appears:
Empty flash at 0x000000f8 ends at 0x00000200
This is caused by the padding added by either mkfs.jffs2 -p512
or nandwrite -p, because this padding is 0xff, which jffs2
sees as "free space which was wasted" (when jffs2 flushes
a page to disk it pads with 0x00, so it can tell that this space
was deliberately left unused).
(I think this warning will evetually go away when the block is garbage
collected, but this can take a loooong time.)
To avoid this warning I would like to suggest that we either
change mkfs.jffs2 and nandwrite to pad with 0x00, or add
an option to both to choose the padding value.
One additional question: Why does mkfs.jffs2 -p by default
pad to the end of the erase block? When whole pages are written
with all 0xff, but the first N pages of an erase block contain
valid nodes, jffs2 will assume that these pages are freshly
erased and good to write in.
Won't this cause instable bits when written again by jffs2?
(The data sheet for my flash says that there may be up to
three partial page write before erase is needed, but I'm not sure
if this allows to write the same byte twice.)
What I currently do to avoid the issue:
$ mkfs.jffs2 -v -e16384 -d foo -b -n -q | dd bs=512 conv=sync >foo.jffs2
$ flash_eraseall -j /dev/mtd0
$ nandwrite /dev/mtd0 foo.jffs2
Johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: padding in mkfs.jffs2 and nandwrite
2005-12-14 15:37 padding in mkfs.jffs2 and nandwrite Johannes Stezenbach
@ 2005-12-16 17:26 ` Johannes Stezenbach
0 siblings, 0 replies; 2+ messages in thread
From: Johannes Stezenbach @ 2005-12-16 17:26 UTC (permalink / raw)
To: linux-mtd
On Wed, Dec 14, 2005, Johannes Stezenbach wrote:
> I've prepared a jffs2 image with mkfs.jffs2 and written it to
> NAND flash using nandwrite (details below). When the file system
> is mounted r/w and written to, on future mounts the following
> warning appears:
>
> Empty flash at 0x000000f8 ends at 0x00000200
>
> This is caused by the padding added by either mkfs.jffs2 -p512
> or nandwrite -p, because this padding is 0xff, which jffs2
> sees as "free space which was wasted" (when jffs2 flushes
> a page to disk it pads with 0x00, so it can tell that this space
> was deliberately left unused).
> (I think this warning will evetually go away when the block is garbage
> collected, but this can take a loooong time.)
>
> To avoid this warning I would like to suggest that we either
> change mkfs.jffs2 and nandwrite to pad with 0x00, or add
> an option to both to choose the padding value.
>
> One additional question: Why does mkfs.jffs2 -p by default
> pad to the end of the erase block? When whole pages are written
> with all 0xff, but the first N pages of an erase block contain
> valid nodes, jffs2 will assume that these pages are freshly
> erased and good to write in.
> Won't this cause instable bits when written again by jffs2?
> (The data sheet for my flash says that there may be up to
> three partial page write before erase is needed, but I'm not sure
> if this allows to write the same byte twice.)
>
> What I currently do to avoid the issue:
>
> $ mkfs.jffs2 -v -e16384 -d foo -b -n -q | dd bs=512 conv=sync >foo.jffs2
> $ flash_eraseall -j /dev/mtd0
> $ nandwrite /dev/mtd0 foo.jffs2
Would someone be so kind and comment on this?
Why is padding handled differently in fs/jffs2/ and mkfs.jffs2?
Is it a bug?
Greetings,
Johannes
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-12-16 17:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-14 15:37 padding in mkfs.jffs2 and nandwrite Johannes Stezenbach
2005-12-16 17:26 ` Johannes Stezenbach
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox