From: Olivier Galibert <galibert@pobox.com>
To: linux-kernel@vger.kernel.org
Subject: Re: FS: hardlinks on directories
Date: Mon, 4 Aug 2003 22:03:51 +0200 [thread overview]
Message-ID: <20030804200351.GA24036@dspnet.fr.eu.org> (raw)
In-Reply-To: <20030804165002.791aae3d.skraw@ithnet.com>
On Mon, Aug 04, 2003 at 04:50:02PM +0200, Stephan von Krawczynski wrote:
> On Mon, 4 Aug 2003 15:04:28 +0100 (BST)
> Anton Altaparmakov <aia21@cam.ac.uk> wrote:
> > 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...
>
> There is a flaw in this argument. If I am told that mount --bind does just
> about what I want to have as a feature then these applictions must have the
> same problems already (if I mount braindead). So an implementation in fs cannot
> do any _additional_ damage to these applications, or not?
There is a subtle but fundamental difference between mount --bind and
hard links for directories[1]: mounts done under a bind point and
mounts done under the original tree are independant. An example on a
system (rh9) with the "standard" /dev/pts mounted and no devfs:
root@zalem:~ #1 >mkdir x
root@zalem:~ #2 >mount --bind /dev x
root@zalem:~ #3 >ls -l /dev |head -5
total 305
crw------- 1 root root 10, 10 Jan 30 2003 adbmouse
crw-r--r-- 1 root root 10, 175 Jan 30 2003 agpgart
crw------- 1 root root 10, 4 Jan 30 2003 amigamouse
crw------- 1 root root 10, 7 Jan 30 2003 amigamouse1
root@zalem:~ #4 >ls -l x | head -5
total 306
crw------- 1 root root 10, 10 Jan 30 2003 adbmouse
crw-r--r-- 1 root root 10, 175 Jan 30 2003 agpgart
crw------- 1 root root 10, 4 Jan 30 2003 amigamouse
crw------- 1 root root 10, 7 Jan 30 2003 amigamouse1
root@zalem:~ #5 >ls -l x/pts |head -5
total 0
root@zalem:~ #6 >ls -l /dev/pts | head -5
total 0
crw--w---- 1 galibert tty 136, 0 Aug 4 21:56 0
crw--w---- 1 galibert tty 136, 1 Aug 4 21:56 1
crw--w---- 1 galibert tty 136, 2 Aug 4 21:57 2
root@zalem:~ #7 >mount --bind /tmp x/input
root@zalem:~ #8 >ls -l x/input | head -5
total 25
-rw-r--r-- 1 galibert mame 0 Aug 1 23:24 Acrodqnzpn
drwx------ 2 galibert mame 48 Jul 31 22:52 galibert
drwx------ 2 galibert mame 72 Aug 1 22:17 gsrvdir500
srwxrwxrwx 1 wnn wnn 0 Aug 4 21:11 jd_sockV4
root@zalem:~ #9 >ls -l /dev/input | head -5
total 0
crw------- 1 root root 13, 64 Jan 30 2003 event0
crw------- 1 root root 13, 65 Jan 30 2003 event1
crw------- 1 root root 13, 74 Jan 30 2003 event10
crw------- 1 root root 13, 75 Jan 30 2003 event11
You can see that ~root/x and /dev are the same file tree but different
mount spaces. Because of that you can't have a loop, because a bind
mount can't point to a mount space that is a predecessor of itself.
OG.
[1] You can mount --bind files.
next prev parent reply other threads:[~2003-08-04 20:04 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-04 12:15 Stephan von Krawczynski
2003-08-04 12:45 ` Måns Rullgård
2003-08-04 13:22 ` Stephan von Krawczynski
2003-08-04 13:37 ` Christian Reichert
2003-08-04 13:44 ` Stephan von Krawczynski
2003-08-04 14:22 ` Christian Reichert
2003-08-04 15:31 ` Jeff Muizelaar
2003-08-04 16:15 ` Stephan von Krawczynski
2003-08-05 2:45 ` Neil Brown
2003-08-05 9:41 ` Stephan von Krawczynski
2003-08-06 1:12 ` Neil Brown
2003-08-06 10:14 ` Stephan von Krawczynski
2003-08-07 2:27 ` Neil Brown
2003-08-04 12:47 ` Nikita Danilov
2003-08-04 13:32 ` Stephan von Krawczynski
2003-08-04 13:44 ` Andries Brouwer
2003-08-04 13:56 ` Stephan von Krawczynski
2003-08-04 14:04 ` Anton Altaparmakov
2003-08-04 14:50 ` Stephan von Krawczynski
2003-08-04 20:03 ` Olivier Galibert [this message]
2003-08-04 21:16 ` Jesse Pollard
2003-08-04 23:34 ` Stephan von Krawczynski
2003-08-05 14:20 ` Jesse Pollard
2003-08-05 14:44 ` Stephan von Krawczynski
2003-08-04 22:58 ` Andrew Pimlott
2003-08-05 0:19 ` Stephan von Krawczynski
2003-08-05 1:18 ` Andrew Pimlott
2003-08-05 8:04 ` Stephan von Krawczynski
2003-08-05 11:18 ` Wakko Warner
2003-08-04 14:33 ` Jesse Pollard
2003-08-04 15:05 ` Stephan von Krawczynski
2003-08-04 15:57 ` Richard B. Johnson
2003-08-04 21:23 ` Jesse Pollard
2003-08-04 16:11 ` Adam Sampson
2003-08-04 17:00 ` Hans Reiser
2003-08-04 17:18 ` Sean Neakums
2003-08-05 4:53 ` jw schultz
2003-08-04 18:50 ` jlnance
2003-08-04 21:09 ` Jesse Pollard
2003-08-04 22:13 ` Stephan von Krawczynski
2003-08-04 22:32 ` Stephan von Krawczynski
2003-08-04 23:00 ` Randolph Bentson
2003-08-05 0:10 ` Stephan von Krawczynski
2003-08-05 2:09 ` Edgar Toernig
2003-08-05 8:05 ` Stephan von Krawczynski
2003-08-05 12:51 ` Helge Hafting
2003-08-05 13:03 ` Stephan von Krawczynski
2003-08-05 13:13 ` Bernd Petrovitsch
2003-08-05 13:39 ` Stephan von Krawczynski
2003-08-05 13:36 ` Richard B. Johnson
2003-08-05 14:04 ` Stephan von Krawczynski
2003-08-05 14:57 ` Richard B. Johnson
2003-08-05 15:08 ` Stephan von Krawczynski
2003-08-05 15:02 ` Jesse Pollard
2003-08-05 15:12 ` Stephan von Krawczynski
2003-08-05 15:44 ` Trond Myklebust
2003-08-05 14:56 ` Jesse Pollard
2003-08-05 22:08 ` Helge Hafting
2003-08-24 17:35 ` Hans Reiser
2003-08-24 19:02 ` Helge Hafting
2003-08-25 8:27 ` Nikita Danilov
2003-08-25 15:48 ` Hans Reiser
2003-08-05 14:12 ` Jesse Pollard
2003-08-05 14:21 ` Stephan von Krawczynski
2003-08-05 15:53 ` Herbert Pötzl
2003-08-04 20:47 ` Jan Harkes
2003-08-04 15:42 ` Brian Pawlowski
2003-08-04 15:56 ` Stephan von Krawczynski
2003-08-04 16:16 ` Herbert Pötzl
2003-08-04 16:35 ` Stephan von Krawczynski
2003-08-04 16:54 ` Herbert Pötzl
2003-08-04 17:18 ` Stephan von Krawczynski
2003-08-04 17:25 ` Herbert Pötzl
2003-08-04 21:38 ` Jesse Pollard
2003-08-05 0:06 ` Stephan von Krawczynski
2003-08-05 3:11 ` Neil Brown
2003-08-04 21:29 ` Jesse Pollard
2003-08-04 23:42 ` Stephan von Krawczynski
2003-08-05 16:46 ` viro
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=20030804200351.GA24036@dspnet.fr.eu.org \
--to=galibert@pobox.com \
--cc=linux-kernel@vger.kernel.org \
/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
Powered by JetHome