Retaining undelete data on ext3

Theodore Tso tytso at
Sun Oct 8 19:40:20 UTC 2006

On Sun, Oct 08, 2006 at 07:40:12PM +0200, Bodo Thiesen wrote:
> We are talking about commiting transactions or not committing
> transactions.  Assume we have a big file, and ind block I1, dind
> block D1 and tind block T must be changed to be self-consistent. Ok,
> no problem, we store the original contents of this three blocks in
> memory, and then update (i.e. zero out) some parts. In the next
> transaction, we need to change I2, D2 and T. If I1 != I2, we restore
> I1 in this transaction - it's no longer needed, remember the old
> content of I2 and log the changes for I2 in the journal. Same

"In the next transaction" --- that's exactly the problem, as I said,
in my earlier comment:

   You could if you forced transaction boundaries between every single
   indirect block, but that would seriously degrade ext3's unlink
   performance, and slow down any other filesystem activity that might be
   happenning at the same time.

The way ext3 works is that we batch multiple operations into a single
transaction.  This is because commiting transactions is expensive, so
we amortize the cost over potentially a large number of filesystem
operations that might be happening very close together.

So your "trick" would require force a single unlink system call to
require into multiple ext3 transactions, each which would have to be
written to the disk, and which would have to stall until all journal
blocks have been written to the disk before the journal commit block
is written.  The resulting performance degradation would be

							- Ted

More information about the Ext3-users mailing list