All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Alexander G. M. Smith" <agmsmith@rogers.com>
To: reiserfs-list@namesys.com
Subject: Re: FS: hardlinks on directories
Date: Sun, 24 Aug 2003 15:15:19 -0400 EDT	[thread overview]
Message-ID: <6563395606-BeMail@cr593174-a> (raw)
In-Reply-To: <3F48F77D.7040907@namesys.com>

Hans Reiser wrote on Sun, 24 Aug 2003 21:35:57 +0400:
>Helge Hafting wrote:
>>On Tue, Aug 05, 2003 at 03:03:51PM +0200, Stephan von Krawczynski wrote:
>>>On Tue, 05 Aug 2003 14:51:46 +0200 Helge Hafting <helgehaf@aitel.hist.no> wrote:
>>>>Even more fun is when you have a directory loop like this:
>>>>
>>>>mkdir A
>>>>cd A
>>>>mkdir B
>>>>cd B
>>>>make hard link C back to A
>>>>
>>>>cd ../..
>>>>rmdir A
>>>>
>>>>You now removed A from your home directory, but the
>>>>directory itself did not disappear because it had
>>>>another hard link from C in B.
>>>>      
>>>>
>>>How about a truly simple idea: 
>>>
>>>rmdir A says "directory in use" and is rejected
>>>
>>>    
>>>
>>Then anybody can prevent you from removing your obsolete directories
>>by creating links to them.  Existing hard link don't have
>>such problems.
>>  
>>
> So, he needs links that count as references, links that don't count as 
> references but disappear if the object disappears (without dangling like 
> symlinks), and unlinkall(), which removes an object and all of its 
> links.  He needs for the first reference to a directory to be removable 
> only by removing all links to the object, or designating another link to 
> be the "first" reference.
> 
> Sounds clean to me.  This is not to say that I am funded to write 
> it.;-)  I'd look at a patch though.....;-)
> 
> I need to write up a taxonomy of links..... after reiser4 ships.....

I handled it differently in my RAM file system.  It supports hard links
to directories, and to anything else too.  It does a full graph traversal
to find the affected things when you try to delete a directory.  If the
deleted directory doesn't isolate anything, it just gets deleted.  Yes,
there is a "first" reference to the main ".." parent directory, which
gets changed to some other directory if the parent connection is
deleted.  If some parts of the file system name space get isolated
(other than the directory you are deleting), it doesn't allow the
operation and returns an error.  I considered letting it automatically
delete the isolated parts (actually trivial to implement), but thought
that users might get annoyed when, for example, "rmdir /etc" would
actually erase /etc and all its contents.

Under the hood, there are a few changes to make it possible.  One is
that all things have a list of their parent directories (and parent
hard links), not just an nLink counter.  This definitely isn't your
grandfather's Unix :-).  Another side effect is that file system
objects have a canonical path and True Names.  See
http://members.rogers.com/agmsbeos/AGMSLinkExplanation.txt
if you want the details on the design decisions.

- Alex

  parent reply	other threads:[~2003-08-24 19:15 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-04 12:15 FS: hardlinks on directories Stephan von Krawczynski
2003-08-04 12:45 ` Måns Rullgård
2003-08-04 13:22   ` Stephan von Krawczynski
2003-08-04 13:37     ` Christian Reichert
2003-08-04 13:44       ` Stephan von Krawczynski
2003-08-04 14:22         ` Christian Reichert
2003-08-04 15:31     ` Jeff Muizelaar
2003-08-04 16:15       ` Stephan von Krawczynski
2003-08-05  2:45         ` Neil Brown
2003-08-05  9:41           ` Stephan von Krawczynski
2003-08-06  1:12             ` Neil Brown
2003-08-06 10:14               ` Stephan von Krawczynski
2003-08-07  2:27                 ` Neil Brown
2003-08-04 12:47 ` Nikita Danilov
2003-08-04 13:32   ` Stephan von Krawczynski
2003-08-04 13:44 ` Andries Brouwer
2003-08-04 13:56   ` Stephan von Krawczynski
2003-08-04 14:04     ` Anton Altaparmakov
2003-08-04 14:50       ` Stephan von Krawczynski
2003-08-04 20:03         ` Olivier Galibert
2003-08-04 21:16         ` Jesse Pollard
2003-08-04 23:34           ` Stephan von Krawczynski
2003-08-05 14:20             ` Jesse Pollard
2003-08-05 14:44               ` Stephan von Krawczynski
2003-08-04 22:58         ` Andrew Pimlott
2003-08-05  0:19           ` Stephan von Krawczynski
2003-08-05  1:18             ` Andrew Pimlott
2003-08-05  8:04               ` Stephan von Krawczynski
2003-08-05 11:18                 ` Wakko Warner
2003-08-04 14:33     ` Jesse Pollard
2003-08-04 15:05       ` Stephan von Krawczynski
2003-08-04 15:57         ` Richard B. Johnson
2003-08-04 21:23           ` Jesse Pollard
2003-08-04 16:11         ` Adam Sampson
2003-08-04 17:00         ` Hans Reiser
2003-08-04 17:18           ` Sean Neakums
2003-08-05  4:53           ` jw schultz
2003-08-04 18:50         ` jlnance
2003-08-04 21:09         ` Jesse Pollard
2003-08-04 22:13           ` Stephan von Krawczynski
2003-08-04 22:32           ` Stephan von Krawczynski
2003-08-04 23:00             ` Randolph Bentson
2003-08-05  0:10               ` Stephan von Krawczynski
2003-08-05  2:09                 ` Edgar Toernig
2003-08-05  8:05                   ` Stephan von Krawczynski
2003-08-05 12:51             ` Helge Hafting
2003-08-05 13:03               ` Stephan von Krawczynski
2003-08-05 13:13                 ` Bernd Petrovitsch
2003-08-05 13:39                   ` Stephan von Krawczynski
2003-08-05 13:36                 ` Richard B. Johnson
2003-08-05 14:04                   ` Stephan von Krawczynski
2003-08-05 14:57                     ` Richard B. Johnson
2003-08-05 15:08                       ` Stephan von Krawczynski
2003-08-05 15:02                     ` Jesse Pollard
2003-08-05 15:12                       ` Stephan von Krawczynski
2003-08-05 15:44                       ` Trond Myklebust
2003-08-05 14:56                   ` Jesse Pollard
2003-08-05 22:08                 ` Helge Hafting
2003-08-24 17:35                   ` Hans Reiser
2003-08-24 19:02                     ` Helge Hafting
2003-08-24 19:15                     ` Alexander G. M. Smith [this message]
2003-08-25  8:27                     ` Nikita Danilov
2003-08-25 15:48                       ` Hans Reiser
2003-08-05 14:12             ` Jesse Pollard
2003-08-05 14:21               ` Stephan von Krawczynski
2003-08-05 15:53                 ` Herbert Pötzl
2003-08-04 20:47     ` Jan Harkes
2003-08-04 15:42   ` Brian Pawlowski
2003-08-04 15:56     ` Stephan von Krawczynski
2003-08-04 16:16       ` Herbert Pötzl
2003-08-04 16:35         ` Stephan von Krawczynski
2003-08-04 16:54           ` Herbert Pötzl
2003-08-04 17:18             ` Stephan von Krawczynski
2003-08-04 17:25               ` Herbert Pötzl
2003-08-04 21:38           ` Jesse Pollard
2003-08-05  0:06             ` Stephan von Krawczynski
2003-08-05  3:11           ` Neil Brown
2003-08-04 21:29       ` Jesse Pollard
2003-08-04 23:42         ` Stephan von Krawczynski
2003-08-05 16:46           ` viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6563395606-BeMail@cr593174-a \
    --to=agmsmith@rogers.com \
    --cc=reiserfs-list@namesys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.