cache_lookup() work this week.

Pawel Jakub Dawidek nick at garage.freebsd.pl
Thu Sep 4 06:59:04 PDT 2003


On Wed, Sep 03, 2003 at 02:43:58PM -0700, Matthew Dillon wrote:
+> :  How do tree walking programs resolve cycles created by hardlinking
+> :  directories.
+> :
+> :  ie. ln /tmp /tmp/recurse; rm -rf /tmp/*
+> 
+>     It's fairly easy to teach something like rm about cycles, it need only
+>     record the inode number for the directory path it maintains while
+>     removing the files.  But it's probably safer to disallow cyclic links
+>     or, at least, the initial creation of a cyclic link.

IMHO teaching all utilities from base system and from ports collection about
directory hardlinks isn't good idea. This problem also affects syscalls
(open(2) need to detect such loops as well).

And cycles detection isn't so trivial IMHO and is time consuming. This could
the reason why ELOOP error exists instead of detecting cycles in applications.

+>     A directory hardlink can very usefully replace what people use nullfs
+>     mounts for now, as well as other things.

The biggest problem with nullfs are deadlocks, so if you'll create
deadlocks-free mechanism, better thing to do will be just use of nullfs.
Nullfs also provides mount flags, so it is much powerfull than directory
hardlinks.

-- 
Pawel Jakub Dawidek                       pawel at xxxxxxxxxxx
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net
Attachment:
pgp00006.pgp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pgp00006.pgp
Type: application/octet-stream
Size: 305 bytes
Desc: "Description: PGP signature"
URL: <http://lists.dragonflybsd.org/pipermail/kernel/attachments/20030904/a38feb7c/attachment-0015.obj>


More information about the Kernel mailing list