Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Sun, 17 Mar 2002 16:20:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Sun, 17 Mar 2002 16:20:41 -0500 Received: from waste.org ([209.173.204.2]:62878 "EHLO waste.org") by vger.kernel.org with ESMTP id ; Sun, 17 Mar 2002 16:20:33 -0500 Date: Sun, 17 Mar 2002 15:20:19 -0600 (CST) From: Oliver Xymoron To: Mark Mielke cc: "Theodore Y. Ts'o" , Paul Allen , linux-kernel Subject: Re: Ext2 zeros inode in directory entry when deleting files. In-Reply-To: <20020317131702.A16140@mark.mielke.cc> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Sun, 17 Mar 2002, Mark Mielke wrote: > On Sun, Mar 17, 2002 at 11:21:08AM -0600, Oliver Xymoron wrote: > > Also, (for the benefit of our readers) in the case of ext2 directories, > > dirents are in the form > > [inode][reclen][namelen]["name"][inode][reclen][namelen]["name"] > > where reclen is effectively a pointer to the next record. It should be > > sufficient for the purposes of e2fsck and the kernel that records be > > unlinked from the list by extending the previous record and the inode in > > the entry be marked unused in the inode bitmap. So I see no reason to be > > zeroing the contents of unreferenced disk space, as it needlessly hinders > > future rescue attempts. > > Out of curiosity... how would you mark the first entry in a directory > as 'deleted' under your suggestion? It's not a suggestion, the current code already does this: /* * ext2_delete_entry deletes a directory entry by merging it with the * previous entry. Page is up-to-date. Releases the page. */ ... if (pde) pde->rec_len = cpu_to_le16(to-from); As it happens, the first entry tends to be '.'. > Also, I'm not certain, but I suspect that the reclen vs namelen > difference allows the ext2(/3) format to be extended while minimizing > breakage to existing code. One day another field might be added to the > inode and any assumptions regarding the size of a record length would > limit such extensions. (One such field is currently the 'file type', > although, the file type does not actually use up any additional bytes) Doesn't matter, reclen still makes it a linked list, and we'd still skip over 'dead' entries, regardless of content. -- "Love the dolphins," she advised him. "Write by W.A.S.T.E.." - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/