Quoting David Masover <[EMAIL PROTECTED]>:

[...]

> [EMAIL PROTECTED] wrote:

[...]

> >
> The problem here is that if the link itself is on a different filesystem 
> than the actual data, and the original filesystem gets nuked, what do I 
> do about the link?  Traditionally, in order to delete a link, you drop 
> the refcount of whatever it points to.  Here, you'd be left with the 
> choice of either having a way to forceably remove a link, even if it 
> can't adjust the refcount, and have "lost chains" or orphaned files, or 
> you'd be left with certain links that you cannot remove without 
> reformatting that filesystem -- possibly in the process creating more 
> such links on other filesystems. 

If the child file's filesystem gets unmounted, then the external link to the 
child file should normally be deleted; it certainly shouldn't be left hanging. 
The child file won't just have a refcount; it will have pointers back to all of 
its external parent directories (and possibly its internal ones too). So there's 
no danger of external references being mistaken for ordinary internal ones. And 
the external reference information can be used to figure out where to reconnnect 
the filesystem when it is next remounted - exactly how is a longer story though.

> Or you could just not have the 
> refcounts (or, indirectly, the deletion of the file) have anything to do 
> with any hardlinks (maybe "firmlinks"?) on other partitions/filesystems, 
> but then the file goes away when all hardlinks are gone, leaving these 
> "firmlinks" broken.

'Firmlinks' is probably a bad word, since apparently the things are known as
weak references in garbagecollectionese.

> 
> I guess the main problem I have with this is that it only works when 
> we're talking about all the filesystems on the local machine, and then 
> only so far.  It kind of falls apart with removable filesystems like 
> floppies and cds.

There are several different ways you can handle filesystems which are
frequently mounted and remounted. Old single-tree filesystems can probably be
adapted or fooled into working reasonably well with external hard links too. (I
expect that making them work with multiple hard-links to directories would be
more difficult.)

[...]

Leo.

-----------------------------------------------------------------
University of St Andrews Webmail: http://webmail.st-andrews.ac.uk

Reply via email to