What happens to the directory entry of a file when it is deleted using rm

This is a discussion on What happens to the directory entry of a file when it is deleted using rm within the Linux Administration forums, part of the Linux Forums category; Does anyone know what exactly happens to the directory entry of a file when that file is deleted? (Assuming you ...


Go Back   Usenet Forums > Linux Forums > Linux Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-23-2003
J Trost
 
Posts: n/a
Default What happens to the directory entry of a file when it is deleted using rm

Does anyone know what exactly happens to the directory entry of a file
when that file is deleted? (Assuming you used the standard rm command
and you are using the ext2fs) Is the entry zeroed out? Or is it
"simply included in the slack space of the previous entry" (the Grugq
-- Phrack, issue 59)? I read the Design and Implementation of the
Second Extended Filesystem
(http://e2fsprogs.sourceforge.net/ext2intro.html), and it didn't
confirm the Grugq's claim.

I would appreciate any and all help.
Thanks,

--Trost
Reply With Quote
  #2 (permalink)  
Old 07-23-2003
Lew Pitcher
 
Posts: n/a
Default Re: What happens to the directory entry of a file when it is deletedusing rm

Without hesitation, J Trost asserted (on or about 07/22/03 22:09) that:
> Does anyone know what exactly happens to the directory entry of a file
> when that file is deleted? (Assuming you used the standard rm command
> and you are using the ext2fs) Is the entry zeroed out? Or is it
> "simply included in the slack space of the previous entry" (the Grugq
> -- Phrack, issue 59)? I read the Design and Implementation of the
> Second Extended Filesystem
> (http://e2fsprogs.sourceforge.net/ext2intro.html), and it didn't
> confirm the Grugq's claim.


In the 2.4.21 kernel source, fs/ext2/dir.c has the following comments
associated with the function that deletes directory entries...

/*
* ext2_delete_entry deletes a directory entry by merging it with the
* previous entry. Page is up-to-date. Releases the page.
*/

The code seems to do what the comment suggests that it does.

--
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576 (http://counter.li.org/)
Slackware - Because I know what I'm doing.

Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 08:35 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0