public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Ext2 zeros inode in directory entry when deleting files.
@ 2002-03-16  8:24 Paul Allen
  2002-03-16  9:02 ` Alexander Viro
  2002-03-17  7:25 ` tytso
  0 siblings, 2 replies; 9+ messages in thread
From: Paul Allen @ 2002-03-16  8:24 UTC (permalink / raw)
  To: linux-kernel

While helping a friend recover from a catastrophic "rm -rf" accident,
I discovered that deleted files have the inode number in their old
directory entries zeroed.  This makes it impossible to match file
names with recovered files.  I've verified this behavior on Mandrake
8.1 with Mandrake's stock 2.4.8 kernel.  In my kernel sources and
in the stock 2.4.8 sources, the function ext2_delete_entry() in
fs/ext2/dir.c has this line:

	dir->inode = 0;

I've done some searching with Google for discussion of this feature.
I didn't find any, but I did find a patch that appears to have
introduced the above line and an "annotated" listing of dir.c
suggesting that the line is part of revision 1.2.  The patch that
apparently introduced this line looks like it was part of a major
overhaul.

Now, I'm tempted to comment the line out in my kernel and see
what happens.  But it does occur to me that hackers with more
experience than I may zeroing the inode number for a reason and
may be depending on it elsewhere in the kernel.  Or perhaps the
ext2 flavor of fsck will malfunction if deleted directory entries
have a non-zero inode?

Can anybody suggest a reason for the existence of the above line
in fs/ext2/dir.c?  Or possibly suggest what would certainly break
if I removed it in my kernel?

Thanks!

Paul Allen
allenp@nwlink.com


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2002-03-19  5:06 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-03-16  8:24 Ext2 zeros inode in directory entry when deleting files Paul Allen
2002-03-16  9:02 ` Alexander Viro
2002-03-17  7:25 ` tytso
2002-03-17 17:21   ` Oliver Xymoron
2002-03-17 18:17     ` Mark Mielke
2002-03-17 21:20       ` Oliver Xymoron
2002-03-17 23:53         ` Mark Mielke
2002-03-19  0:50           ` Paul Allen
2002-03-19  1:34             ` Andreas Dilger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox