[lkml]   [2006]   [May]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Which process context does /sbin/hotplug run in?
On May 15, 2006, at 15:59, Rob Landley wrote:
> On Monday 15 May 2006 12:17 am, Kyle Moffett wrote:
>>> I can CD into them endlessly, and both "ls -lR" and "find ."
>>> report cycles in the tree, which surprised me that they had a
>>> specific error message for that, actually. Good enough for me. :)
>> Odd, I'm unable to replicate that behavior here. If I run "ls /
>> var/sub2/sub2" I don't get any entries. Find and ls -lR have
>> error messages of that because it can occasionally be triggered
>> with symlinks and such.
> Perhaps I copied it down wrong. I did this in a 2.6.16 UML
> instance...
> sh-3.00# mount -t tmpfs /tmp /tmp
> sh-3.00# cd /tmp
> sh-3.00# mkdir woot
> sh-3.00# mount --bind woot /var
> sh-3.00# cd /var
> sh-3.00# mkdir sub
> sh-3.00# mount --move /tmp sub
> sh-3.00# ls -lR
> .:
> total 0
> drwxrwxrwt 3 root root 60 May 15 15:57 sub
> ./sub:
> total 0
> drwxr-xr-x 3 root root 60 May 15 15:57 woot
> ls: not listing already-listed directory: ./sub/woot
> sh-3.00# find .
> .
> ./sub
> find: Filesystem loop detected; `./sub/woot' has the same device
> number and
> inode as a directory which is 2 levels higher in the filesystem
> hierarchy.
> ./sub/woot
> sh-3.00#
> Works for me. :)

I get the exact same behavior, but:

sh-3.00# ls -alh /var/sub/woot/sub
total 0
drwxr-xr-x 2 root root 40 May 15 18:09 .
drwxr-xr-x 3 root root 60 May 15 18:09 ..

It does *not* recurse indefinitely here, because the mount tree is
not recursive. A bind mount (Or a --move, which is bind and umount -
l), does not share submounts, so it's impossible to circularly link
them. This is why it's possible to do this:

mount --bind /var /apache1/bin
mount --bind /var /apache2/var
mount --bind /www1 /apache1/var/www
mount --bind /www2 /apache2/var/www

Kyle Moffett

There are two ways of constructing a software design. One way is to
make it so simple that there are obviously no deficiencies. And the
other way is to make it so complicated that there are no obvious
deficiencies. The first method is far more difficult.
-- C.A.R. Hoare

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2006-05-16 00:25    [W:0.064 / U:5.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site