DragonFly BSD
DragonFly kernel List (threaded) for 2003-09
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: cache_lookup() work this week.

From: Pawel Jakub Dawidek <nick@xxxxxxxxxxxxxxxxx>
Date: Thu, 4 Sep 2003 15:58:59 +0200

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

Pawel Jakub Dawidek                       pawel@xxxxxxxxxxx
UNIX Systems Programmer/Administrator     http://garage.freebsd.pl
Am I Evil? Yes, I Am!                     http://cerber.sourceforge.net

Attachment: pgp00006.pgp
Description: PGP signature

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