Re: FS: hardlinks on directories

Anton Altaparmakov
2003-08-04T14:04:31Z

On Mon, 4 Aug 2003, Stephan von Krawczynski wrote:
> On Mon, 4 Aug 2003 15:44:15 +0200
> Andries Brouwer <aebr@win.tue.nl> wrote:
> > On Mon, Aug 04, 2003 at 02:15:48PM +0200, Stephan von Krawczynski wrote:
> > > although it is very likely I am entering (again :-) an ancient discussion I
> > > would like to ask why hardlinks on directories are not allowed/no supported
> > > fs action these days.
> >
> > Quite a lot of software thinks that the file hierarchy is a tree,
> > if you wish a forest.
> >
> > Things would break badly if the hierarchy became an arbitrary graph.
>
> Care to name one? What exactly is the rule you see broken? Sure you can build
> loops, but you cannot prevent people from doing braindamaged things to their
> data anyway. You would not ban dd either for being able to flatten your
> harddisk only because of one mistyping char...
> Every feature can be misused and then damaging, but that is no real reason not
> to have it - IMHO.

For a start the kernel VFS dcache would break because you end up with
multiple entries for each inode, one entry for each parallel directory
tree. Read-only you are just about able to get away with it (been there,
done that, don't recommend it!) but allow files to be deleted and it will
blow up in your face.

You ask for examples of applications? There are millions! Anything that
walks the directory tree for a start, e.g. ls -R, find, locatedb, medusa,
du, any type of search and/or indexing engine, chown -R, cp -R, scp
-R, chmod -R, etc...

Best regards,

Anton
--
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Unix Support, Computing Service, University of Cambridge, CB2 3QH, UK
Linux NTFS maintainer / IRC: #ntfs on irc.freenode.net
WWW: http://linux-ntfs.sf.net/ & http://www-stu.christs.cam.ac.uk/~aia21/