Re: FS: hardlinks on directories

From: Adam Sampson (azz_at_us-lot.org)
Date: 08/04/03

  • Next message: Stephan von Krawczynski: "Re: FS: hardlinks on directories"
    To: linux-kernel@vger.kernel.org
    Date:	Mon, 04 Aug 2003 17:11:17 +0100
    
    

    Stephan von Krawczynski <skraw@ithnet.com> writes:

    > All that can handle symlinks already have the same problem
    > nowadays. Where is the difference?

    lstat() will tell you if a file is a symlink; if you only walk into
    directories, then you're guaranteed not to get into a loop. If you've
    got two hardlinks to a directory, how do you make that available in
    stat() output, and how does a tree-walking program know which to walk
    into? You could do the rsync trick of keeping track of every
    device-inode pair you've seen to detect hardlinks, but that's horribly
    non-space-efficient on large directories -- particularly bad for
    backups.

    I could imagine this functionality maybe being useful for system
    administrators, but with normal Unixish userspace, it doesn't strike
    me as a good idea to give users the ability to create hardlinks to
    directories.

    -- 
    Adam Sampson <azz@us-lot.org>                        <http://offog.org/>
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Stephan von Krawczynski: "Re: FS: hardlinks on directories"

    Relevant Pages

    • Re: whats next for the linux kernel?
      ... That is stupid beyond belief and ... > only the Unix community doesn't get it. ... The file only goes away if there are no other hardlinks to it. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: silent semantic changes with reiser4
      ... the dcache seems to have no problems unlinking/unhashing a ... unlinking a non-empty directory can be evil). ... Also, we cannot create hardlinks to a directory, but I guess ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: FS: hardlinks on directories
      ... about what I want to have as a feature then these applictions must have the ... My saying is not "I want to have hardlinks for creating a big mess of loops ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: reiser4 plugins
      ... > with the number of hardlinks, ... > The only other doomsday scenario is if we have a ludicrously deep tree. ... _no hardlinks to files_ (the file system ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Symlink & Hardlink
      ... Einen Symlink zu erkennen ist ja noch recht einfach ... ... aber wie erkenne ich einen HradLink? ... ls -l sieht bei mir auf Hardlinks genauso aus wie auf einer echten Datei? ...
      (de.comp.os.unix.shell)