mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kyle Moffett <mrmacman_g4@mac.com>
To: Rob Landley <rob@landley.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Which process context does /sbin/hotplug run in?
Date: Mon, 15 May 2006 18:22:41 -0400	[thread overview]
Message-ID: <64472CD2-5640-4611-B631-035AF83F7BB0@mac.com> (raw)
In-Reply-To: <200605151559.09504.rob@landley.net>

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 ..
sh-3.00#

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

Cheers,
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



      reply	other threads:[~2006-05-15 22:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-12 18:20 Rob Landley
2006-05-13  7:24 ` Kyle Moffett
2006-05-15  0:08   ` Rob Landley
2006-05-15  4:17     ` Kyle Moffett
2006-05-15  4:28       ` Joshua Hudson
2006-05-15 19:59       ` Rob Landley
2006-05-15 22:22         ` Kyle Moffett [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=64472CD2-5640-4611-B631-035AF83F7BB0@mac.com \
    --to=mrmacman_g4@mac.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®