All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Reiser <reiser@namesys.com>
To: Nikita Danilov <nikita@clusterfs.com>
Cc: Jonathan Briggs <jbriggs@esoft.com>,
	Valdis.Kletnieks@vt.edu,
	"Alexander G. M. Smith" <agmsmith@rogers.com>,
	leocomerford@gmail.com, reiserfs-list@namesys.com,
	ninja@slaphack.com
Subject: Re: File as a directory - VFS Changes
Date: Tue, 31 May 2005 11:32:04 -0700	[thread overview]
Message-ID: <429CADA4.4070600@namesys.com> (raw)
In-Reply-To: <17052.43941.64870.716568@gargle.gargle.HOWL>

What about if we have it that only the first name a directory is created
with counts towards its reference count, and that if the directory is
moved if it is moved from its first name, the new name becomes the one
that counts towards the reference count?   A bit of a hack, but would work.

Hans

Nikita Danilov wrote:

>Jonathan Briggs writes:
> > On Tue, 2005-05-31 at 12:30 -0400, Valdis.Kletnieks@vt.edu wrote:
> > > On Tue, 31 May 2005 08:04:42 PDT, Hans Reiser said:
> > > 
> > > > >Cycle may consists of more graph nodes than fits into memory. 
> > > > >
> > > > There are pathname length restrictions already in the kernel that should
> > > > prevent that, yes?
> > > 
> > > The problem is that although a *single* pathname can't be longer than some
> > > length, you can still create a cycle.  Consider for instance a pathname restriction
> > > of 1024 chars.  Filenames A, B, and C are all 400 characters long.  A points at B,
> > > B points at C - and C points back to A.
> > > 
> > > Also, although the set of inodes *in the cycle* fits in memory, the set of
> > > inodes *in the entire graph* that has to be searched to verify the presence of
> > > a cycle may not (in general, you have to be ready to examine *all* the inodes
> > > unless you can do some pruning (unallocated, provably un-cycleable, and so
> > > on)).  THis is the sort of thing that you can afford to do in userspace during
> > > an fsck, but certainly can't do in the kernel on every syscall that might
> > > create a cycle...
> > 
> > You can avoid cycles by redefining the problem.
> > 
> > Every file or "data object" has one single True Name which is their
> > inode or OID.  Each data object then has one or more "names" as
> > properties.  Names are either single strings with slash separators for
> > directories, or each directory element is a unique object in an object
> > list.  Directories then become queries that return the set of objects
> > holding that directory name.  The query results are of course cached and
> > updated whenever a name property changes.
> > 
> > Now there are no cycles, although a naive Unix "find" program could get
> > stuck in a loop.
>
>Huh? Cycles are still here.
>
>Query D0 returns D1, query D1 returns D2, ... query DN returns D0. The
>problem is not in the mechanism used to encode tree/graph structure. The
>problem is in the limitations imposed by required semantics:
>
>   (R) every object except some selected root is Reachable. (No leaks.)
>
>   (G) unused objects are sooner or later discarded. (Garbage
>   collection.)
>
>Neither requirement is compatible with cycles in the directory
>structure:
>
> - from (R) it follows that object can be discarded only if it empty (as
> a directory). All nodes in a cycle are not empty (because each of them
> contains at least a reference to the next one), and hence none of them
> can be ever removed;
>
> - if garbage collection is implemented through the reference counting
> (which is the only known way tractable for a file system), then cycles
> are never collected.
>
>Unless you are talking about a two-level naming scheme, where "One True
>Names" are visible to the user. In that case reachability problem
>evaporates, because manipulations with normal directory structure never
>make node unreachable---it is always accessible through its True
>Name.
>
>But the garbage collection problem is still there. You are more than
>welcome to solve it by implementing generation mark-and-sweep GC on file
>system scale. :-)
>
>Nikita.
>
>
>  
>


  reply	other threads:[~2005-05-31 18:32 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-28  0:46 File as a directory - Ordered Relations Alexander G. M. Smith
2005-05-28  4:56 ` David Masover
2005-05-28 19:42   ` Valdis.Kletnieks
2005-05-29 17:58     ` File as a directory - VFS Changes Alexander G. M. Smith
2005-05-30  8:25       ` Hans Reiser
2005-05-30 11:00       ` Nikita Danilov
2005-05-31  0:20         ` Alexander G. M. Smith
2005-05-31  9:34           ` Nikita Danilov
2005-05-31 15:04             ` Hans Reiser
2005-05-31 16:00               ` Nikita Danilov
2005-05-31 16:30               ` Valdis.Kletnieks
2005-05-31 16:55                 ` Jonathan Briggs
2005-05-31 16:59                   ` Hans Reiser
2005-05-31 17:13                     ` Jonathan Briggs
2005-05-31 18:27                       ` Hans Reiser
2005-05-31 21:01                         ` Jonathan Briggs
2005-05-31 21:08                           ` Jonathan Briggs
2005-05-31 22:36                             ` Nikita Danilov
2005-05-31 23:01                               ` Jonathan Briggs
2005-06-01 10:39                                 ` Nikita Danilov
2005-06-01 10:43                                   ` Nikita Danilov
2005-06-01 14:06                                     ` Jonathan Briggs
2005-06-01 14:42                                       ` Nikita Danilov
2005-06-01 15:40                                         ` Jonathan Briggs
2005-06-01 17:27                                           ` Nikita Danilov
2005-06-01 19:03                                             ` Jonathan Briggs
2005-06-02 10:38                                               ` Nikita Danilov
2005-06-02 18:35                                                 ` Jonathan Briggs
2005-06-02 23:54                                                   ` Nikita Danilov
2005-06-03 17:57                                                     ` Hans Reiser
2005-06-04 19:45                                                       ` Nikita Danilov
2005-06-04 20:13                                                         ` David Masover
2005-06-07  5:08                                                         ` Hans Reiser
2005-06-03  6:44                                                   ` Faraz Ahmed
2005-05-31 18:23                   ` Nikita Danilov
2005-05-31 18:32                     ` Hans Reiser [this message]
2005-06-02  1:27                       ` Alexander G. M. Smith
2005-06-02  7:46                         ` Hans Reiser
2005-06-02  9:11                       ` Nikita Danilov
2005-06-02 17:23                         ` Hubert Chan
2005-06-01  2:11             ` Alexander G. M. Smith
2005-06-01 10:58               ` Nikita Danilov
2005-06-02  1:58                 ` Alexander G. M. Smith
2005-06-02 10:03                   ` Nikita Danilov
2005-06-03  3:35                     ` Performance Impacts of Graph Cycles due to Multiple Parents Alexander G. M. Smith
2005-06-03 11:15                       ` Nikita Danilov
2005-06-07  2:04                         ` Alexander G. M. Smith
2005-05-30  8:19     ` File as a directory - Ordered Relations Hans Reiser
2005-05-31 16:46       ` Jonathan Briggs
2005-05-31 17:07         ` Hans Reiser
  -- strict thread matches above, loose matches on Subject: below --
2005-06-02 14:46 File as a directory - VFS Changes Faraz Ahmed

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=429CADA4.4070600@namesys.com \
    --to=reiser@namesys.com \
    --cc=Valdis.Kletnieks@vt.edu \
    --cc=agmsmith@rogers.com \
    --cc=jbriggs@esoft.com \
    --cc=leocomerford@gmail.com \
    --cc=nikita@clusterfs.com \
    --cc=ninja@slaphack.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.