Re: ext3 and undeletion

Alan Cox
2002-03-04T14:58:50Z

> another inode after the trunc op would break unix semantics. In order to
> work, you'd have to use a new inode (in .undelete, of course), copy, then do
> the actual trunc call.
> This would make truncation expensive, whereas before it was pretty fast.
> Modifying unlink will probably suffice.

You would need to hook the truncate/unlink paths in the file system. If
you are doing it within the fs it becomes cheap (at least for ext2) - as
you can simply reassign the data blocks to a new inode, stuff the new inode
into the magic "stuff we deleted" directory and continue.