From owner-freebsd-hackers Wed Sep 25 10:18: 0 2002 Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4896637B401 for ; Wed, 25 Sep 2002 10:17:58 -0700 (PDT) Received: from pintail.mail.pas.earthlink.net (pintail.mail.pas.earthlink.net [207.217.120.122]) by mx1.FreeBSD.org (Postfix) with ESMTP id D2CD443E65 for ; Wed, 25 Sep 2002 10:17:57 -0700 (PDT) (envelope-from tlambert2@mindspring.com) Received: from pool0448.cvx21-bradley.dialup.earthlink.net ([209.179.193.193] helo=mindspring.com) by pintail.mail.pas.earthlink.net with esmtp (Exim 3.33 #1) id 17uFnI-0005iV-00; Wed, 25 Sep 2002 10:17:48 -0700 Message-ID: <3D91EF7A.EF4918C@mindspring.com> Date: Wed, 25 Sep 2002 10:16:42 -0700 From: Terry Lambert X-Mailer: Mozilla 4.79 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Dan Nelson Cc: Julian Stacey , Paolo Pisati , freebsd-hackers@FreeBSD.ORG Subject: Re: Hey, is there space for a newbie? =) References: <20020924175642.GB87963@southcross.skynet.org> <200209250958.g8P9wXE10208@flip.jhs.private> <20020925151358.GD16302@dan.emsphone.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Dan Nelson wrote: > You don't need journaling for undelete capability. When you delete a > file on Netware, the file is simply marked "deleted" but the filename > stays in the directory, and duplicate deleted filenames are allowed. > When true free disk space gets low, deleted files are purged in the > background, oldest first (I believe). There is an API for listing, > salvaging, and manually purging deleted files. I know Netware 3 had > salvage capabilities, and it certainly didn't have a journalling FS :) > > You might be able to misuse the Whiteout file type in FFS to present a > similar user interface. unlink(2) would rename the file to > filename.timestamp and whiteoute it. ls -W, rm -W, and rm would list, > salvage, and purge, respectively. Since S_IFWHT is a filetype, you > would have to only allow file deletion, or encode the original filetype > somewhere else. > > Alternatively, you could add a file flag equivalent to whiteout. > "invisible" or something, and use chflags to salvage. As the author of NXFS (The NetWare for UNIX extended File System) for Novell in 1993/1994, I can say that things are a little more complicated than that, when it comes to undelete. The NetWare undelete functionality, in particular, the ability to delete multiple files of the same name, required that globbing take place in the kernel, and that the "deleted" files be marked not only in the inode, but in the directory space as well. The ability to support hard links is particularly problematic, as is the ability to recover a particular version of the file. I can pretty much guarantee you that "whiteouts" would not work; they exist as masking objects, for use in stacking FS's that overlay the files in an underlying VFS in a stack: they depend on iterated directory searches for unioned namespaces -- as opposed to consecutived searches, when whiteouts are not an allowed option. The low-space-purge facility is also exhorbitantly expensive, unless you can maintain parent pointers for all files, so that you can traverse the entire non-free inode list, and make a decision that way, and then *delete by inode number*. This basically means that the structure of on disk hard links must change, in order to permit recovery of the removed directory entry that you want to purge (frankly, it doesn't make a lot of sense to purge old "deleted" hard links that still have directory entry links referencing them...). This would be an interesting problem to solve; it is similar to the "versioning FS" problem... which has the same need for kernel globbing for correct implementation (the purge in that case is manual or based on an ACL limit on the number of versions of a file which will be maintained, which makes it much easier). -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message