Investigating du's check for directory loops [1], I was puzzled
that 'du -L' does not diagnose the loop:

  $ mount -t tmpfs /mnt /mnt

  $ mkdir -p /mnt/dir/mnt

  $ mount --bind /mnt /mnt/dir/mnt

  $ cd /mnt

  $ ln -s dir/mnt/dir d

  $ ls -ldogi . d dir dir/mnt
  188923 drwxrwxrwt 3 80 Mar 19 08:52 .
  189802 lrwxrwxrwx 1 11 Mar 19 08:52 d -> dir/mnt/dir
  190673 drwxr-xr-x 3 60 Mar 19 08:52 dir
  188923 drwxrwxrwt 3 80 Mar 19 08:52 dir/mnt

  $ du
  du: mount point ‘./dir/mnt’ already traversed
  0     ./dir
  0     .

  $ du -L
  0     ./d/mnt
  0     ./d
  0     .

I'm just sending this here as a reference, and investigate later.

[1] http://lists.gnu.org/archive/html/coreutils/2014-03/msg00022.html

Have a nice day,
Berny

Reply via email to