Re: Soft metadata updates paper w/code

Theodore Y. Ts'o (tytso@MIT.EDU)
Thu, 24 Jul 1997 22:37:55 -0400

Date: Thu, 24 Jul 97 17:15:32 MDT
From: (Colin Plumb)

Dumb question: what does the system do now? Does it risk having the
device DMA capture a block image halfway through a modification? I
know it's done that way for mmap(), because there's nothing else that
can be done, but I'f I'm shuffling free space in an ext2 directory
block, it could get pretty ugly at the halfway point.

The system doesn't do anything to address the problem. We don't shuffle
directory entries in ext2fs; the most we do is coalesce adjacent free
spaces by adjusting pointer records, which can be done in atomic memory

> The alternative approach would be to copy the block to scratch space and
> modify the scratch copy, and then let the device driver write that out
> to disk.

A third alternative: undo in place, but if you need access while the
write is pending, *then* make a scratch copy.

This is better; although it has as a tradeoff the additional complexity
involved in modifying all of the locations where you might be reading or
writing to metatdata information.

- Ted