Re: FS: hardlinks on directories

From: Stephan von Krawczynski (skraw@ithnet.com)
Date: Mon Aug 04 2003 - 19:10:46 EST


On Mon, 4 Aug 2003 16:00:09 -0700
Randolph Bentson <bentson@holmsjoen.com> wrote:

> On Tue, Aug 05, 2003 at 12:32:10AM +0200, Stephan von Krawczynski wrote:
> > And in just the same way fs could provide a mode bit saying "hi, I am a
> > hardlink", and tar can then easily provide option number 1345 saying
> > "stay away from hardlinks".
>
> Perhaps not a bit, but rather another enumerated value in the type field
> of an inode. (Are there any values left?)
>
> Ok, lets consider this. Suppose that /a/b and /a/c both refer to the same
> directory, where /a/b is a traditional link, but /a/c is a "hardlink".
>
> What happens when one executes 'rmdir /a/b'? Does the directory it
> references disappear? If not, how would tar ever find it? (I have
> this vision of a disk full of these hardlink-only directories which
> tar and perhaps fsck cannot find.)

The setup you describe is exactly the reason why I suggested elsewhere (in a
private discussion) to single-link all directory entries pointing to the same
directory in a list. In case of deletion of the "main" entry, the "main" simply
can walk on to the next (former) hardlink, if there are any left the tree is
deleted completely. That's it.

Regards,
Stephan

-
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/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:25 EST