Re: partially encrypted filesystem

From: Charles Manning
Date: Tue Dec 09 2003 - 21:07:13 EST


On Wednesday 10 December 2003 13:07, Pavel Machek wrote:
>
> > Even if you were going to admit to having a block size of 64KiB to the
> > layers above you, you just can't _do_ atomic replacement of blocks,
> > which is required for normal file systems to operate correctly.
>
> Are those assumptions needed for something else than recovery after
> crash/powerdown? [i.e., afaics 64K ext2 should work on flash, but fsck
> might have some troubles...]

The main reason for this in JFFSx and YAFFS (but particularly JFFSx on NOR)
is that flash memory cannot be arbitrarily overwritten without an erase and
an erase takes a long time.

Eg: NOR flash typically takes around 1 second to erase a block (typically
64kB in size) and approx 10usec or so per byte/word to program. So to change
a single byte in a block in place would typically require something like:
1. Read into buffer
2. Erase block [1 second].
3. Reprogram [0.6 seconds]

+ do that all over again for the update to the file info.

On NAND flash, where erase is far faster, the cost is far less. Still in a
comparison of YAFFS (which uses log structuring for the same reasons as
JFFS2) and FAT + block driver for NAND, YAFFS could sustain a write speed of
approx 10 times the FAT + block driver solution on the same hardware.

Then there are issues like wear levelling (because flash has a limited
lifetime) and bad block handling etc... but performance (and crash recovery)
are the main issues.

-- Charles


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/