Andi Kleen wrote:

Hans Reiser <[EMAIL PROTECTED]> writes:


Because atomicity in ext3 basically consists of guaranteeing that the filesystem is consistent, and due to the disk drive implementation 4k blocks are written atomically. So, if you span more than one block, it is not guaranteed to be atomic.



I was told most modern disks run with 32-64K blocks internally.


This is very interesting, it would explain something that has puzzled me for a long time about 64k being the optimal transfer size.

4K is very unlikely.

Of course they don't always guarantee that a write of such a block
is atomic, but then they also don't guarantee it for 4K.

What they do in the event of power loss is the big unclear for hard drives. Maybe I should ask for government funding to test hard drives for what they actually do, and how they handle power loss.;-) Somebody needs to test these folks.....

Most filesystems are designed based around the assumption that ecc on the drive will detect failed writes with 4k granularity. If I remember right, some folks on this list have said some things suggesting that for some IBM drives a power failure can cause a more than 4k chunk to go bad, and that this can be a problem for filesystem consistency.

It would probably be nice for the OS and the drive to use the same block size..... or at least interesting to experiment with.

The only sure way is to wait for the disk telling you it is finished (= use write barriers) and/or turn the write buffer off.
Even then you have to hope that the disk firmware doesn't lie to you.


-Andi






--
Hans




Reply via email to