Re: ext3 and undeletion

James D Strandboge
2002-03-04T19:17:52Z

[-- Attachment #1: Type: text/plain, Size: 1428 bytes --]

On Mon, 2002-03-04 at 10:12, Alan Cox wrote:
> > Modifying unlink will probably suffice.
I am working on a preliminary patch that does this. My current
implementaion (which is not ready to submit-- but works) added a line to
sys_unlink in fs/namei.c that calls my vfs_undel_link(). The
vfs_undel_link() function is based on the logic of sys_link, and creates
a hard link from the deleted file to one in the "stuff we deleted"
directory. Then vfs_undel_link returns to sys_unlink and original link
is deleted, leaving only the one in the "stuff we deleted" directory.

> 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.
After much consideration, my implementation does not deal with
truncate/overwrite because it would fill up the filesystem and be very
slow in VFS since there would have to be a full copy. Also, staying
high level in VFS makes the patch work over any fs that uses VFS.

When I submit, I will make sure to add RFC to get more input on the
implementation, and possibly dealing with truncate.

Jamie Strandboge

--
Email: jstrand1@rochester.rr.com
GPG/PGP ID: 26384A3A
Fingerprint: D9FF DF4A 2D46 A353 A289 E8F5 AA75 DCBE 2638 4A3A

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 240 bytes --]