libtrash in fedora Core 5

Rudi Chiarito nutello at
Sun Jan 29 18:13:29 UTC 2006

On Sun, Jan 29, 2006 at 01:53:09AM -0600, Callum Lerwick wrote:
> Seems to me journaling should make it easier. Just rewind the journal.

At least with ext2/3, deleting can touch a lot of data on disk, because
of the way block lists are stored in inodes and indirect blocks. Block
lists are large because they use an entry for every single block in the
file. Other filesystems compress the lists in the case of contiguous
groups of blocks (as is often the case) by using so-called extents,
which store the location of the first block in the chunk and the chunk

Journal size is a finite resource, typically 32MB, because it eats disk
space and memory (it might have to be pinned by the kernel to a varying
degree, depending on memory pressure, IIRC). There's only so much you
could keep in there. And a single transaction can only use a portion of
the total journal size. That's why ext3 fills the inode and the indirect
blocks with zeroes right away.

With the current design, the alternative would be a slower or less
safe delete. You could try to be smarter at deleting things, but the
problem with optimisations is that you also need to worry about the
corner case - e.g. when the system is running out of memory - which can
complicate your life a lot.


More information about the fedora-devel-list mailing list