Re: what is necessary for directory hard links

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 24 Jul 2006 10:45:45 +0400, Nikita Danilov said:
> Joshua Hudson writes:

>  > In my filesystem, any attempt to create a loop of hard links
>  > is detected and cancelled. 
> 
> Can you elaborate a bit on this exciting mechanism? Obviously an ability
> to efficiently detect loops would be a break-through in a
> reference-counted garbage collection, somehow missed for last 40

It's actually pretty trivial to do if it's a toy filesystem and all the
relevant inodes are in-memory already.  The hard-to-solve part is getting
around the (apparent) need to walk across essentially the entire tree
structure making sure that you aren't creating a loop.  This can get
rather performance piggy - even /home on my laptop has some 400K
inodes on it, and a 'find /home -type d' takes 28 seconds.  That's a *long*
time to lock and freeze a filesystem.

Where it gets *really* messy is that it isn't just mkdir that's the problem -
once you let there be more than one path from the fs root to a given directory,
it gets *really* hard to make sure that any given 'mv' command isn't going to
to screw things up (is 'mv a/b/c/d ../../w/z/b' safe? How do you know, without
examining a *lot* of stuff under a/ and ../../w/?

Attachment: pgpsewVyKnOvm.pgp
Description: PGP signature


[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux