From: Al Viro <viro@ZenIV.linux.org.uk>
To: Jan Kara <jack@suse.cz>
Cc: Joerg Schilling <schily@schily.net>,
otnaccess@hotmail.com, linux-fsdevel@vger.kernel.org,
joerg@schily.net
Subject: Re: FW: Symbolic link with absolute target path in UDF - not working properly?
Date: Tue, 13 Dec 2011 20:05:15 +0000 [thread overview]
Message-ID: <20111213200515.GI2203@ZenIV.linux.org.uk> (raw)
In-Reply-To: <20111213192526.GA20267@quack.suse.cz>
On Tue, Dec 13, 2011 at 08:25:26PM +0100, Jan Kara wrote:
> > If this is implemented the way it is implemented in Solaris, there is a
> > nearly empty vfs layer, specific to the loopback mount that indirectly
> > calls the vfs functions for the base FS. So on Solaris this is
> > possible and it would work as expected.
> Again, note that loopback mounts are not the hard part here. I could have
> mounted standard block devices and nothing interesting would have changed
> in my example. What is interesting is that I can create a directory tree
> where root of some filesystem is not accessible (there is not a valid path
> that would resolve to it) but it's subdirectory is accessible.
For the sake of completeness:
; mount /dev/sda1 /mnt
; ls /mnt
foo bar
; mkdir /tmp/splat
; mkdir /tmp/wank
; mount --bind /mnt/foo /tmp/splat
; mount --bind /mnt/bar /tmp/wank
; umount /mnt
and at that point we have fs on sda1 still active, with two subtrees bound
to /tmp/splat and /tmp/wank resp. Root from /sda1, however, is _not_
available anywhere in your namespace.
As for the implementation, it's light-weight, all right - more so than
what you seem to describe as Solaris one. We do *not* play with stacking
here; rather than doing that, we have a pair (vfsmount, dentry) used
to describe a point in namespace. The latter is more or less a counterpart
of vnode; the former is a point in mount tree. Note that it is *NOT*
a counterpart of e.g. BSD struct mount - that would be struct super_block.
There may be many vfsmounts refering to the same fs; all of them share
struct super_block, etc. - dentry tree is shared, not mirrored.
All IO is done as usual, pretty much ignoring the vfsmount side of things
(modulo things like per-mountpoint read-only/noatime/etc.). Pathname
resolution acts on (vfsmount,dentry) pair, the first component getting
changed when we hit a mountpoint and when we walk .. from (mnt, mnt->mnt_root).
Process' current directory and root are (vfsmount,dentry) pairs, of course.
Each vfsmount refers to a subtree on some filesystem; those subtrees might
contain one another, etc. - no coherency problems, since the underlying
objects are shared. Filesystem gets shut down when there's no vfsmounts
left.
Moreover, different processes might have completely unrelated mount trees and
any filesystem may have an arbitrary set of subtrees mounted in any namespaces.
Up to sysadmin...
prev parent reply other threads:[~2011-12-13 20:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <SNT126-DS19FDA9F050C2D5E43731CDBEB40@phx.gbl>
2011-12-07 18:06 ` FW: Symbolic link with absolute target path in UDF - not working properly? Jan Kara
[not found] ` <SNT126-DS1C6361C26AD146EBA3BB6BEBE0@phx.gbl>
2011-12-12 14:18 ` Jan Kara
[not found] ` <SNT126-DS114F372B3DA7DF425B8146BEBC0@phx.gbl>
2011-12-13 11:01 ` Joerg Schilling
2011-12-13 16:13 ` Jan Kara
2011-12-13 18:30 ` Joerg Schilling
2011-12-13 19:25 ` Jan Kara
2011-12-13 19:54 ` Joerg Schilling
2011-12-13 20:26 ` Al Viro
2011-12-13 22:41 ` Joerg Schilling
2011-12-14 0:45 ` Al Viro
2011-12-14 17:34 ` Joerg Schilling
2011-12-13 20:05 ` Al Viro [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=20111213200515.GI2203@ZenIV.linux.org.uk \
--to=viro@zeniv.linux.org.uk \
--cc=jack@suse.cz \
--cc=joerg@schily.net \
--cc=linux-fsdevel@vger.kernel.org \
--cc=otnaccess@hotmail.com \
--cc=schily@schily.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;
as well as URLs for NNTP newsgroup(s).