linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: btrfs multiple mounts stacked on the same mount point
Date: Tue, 11 Feb 2014 20:57:07 +0000 (UTC)	[thread overview]
Message-ID: <pan$9211b$42bef7b0$dd1350ae$978558c5@cox.net> (raw)
In-Reply-To: 52F9DCBA.1010002@oracle.com

Anand Jain posted on Tue, 11 Feb 2014 16:18:02 +0800 as excerpted:

> per mount(2)
> 
>   ---
>    multiple mounts can be stacked on the same mount point.
>   ---
> 
>   In this situation how could ioctl communicate (using mount point) with
>   each FS stacked on the same mount point ?
> 
>   BTW I don't understand the need for multiple mounts on the same mount
>   point ?

The most common case of multiple over-mounts is almost certainly the 
kernel's built-in rootfs in RAM, usually as an initramfs or initrd, with 
real-root often directly over-mounted the same mountpoint, tho it can 
also be mounted elsewhere on the initramfs.

The various union-filesystem solutions also directly use over-mounting, 
with the read-only mount often directly over-mounted with the writable 
but semi-transparent overlay, such that if a file hasn't changed from the 
read-only version on the under-mount, that's the version that gets used.

Otherwise, over-mounts generally obscure what's underneath them, making 
direct access to it impossible, unless that underneath filesystem is bind-
mounted elsewhere.

(Which is actually how I backup my root filesystem, using a bind-mount to 
mount it elsewhere for the backup, so for instance the /dev/console and 
/dev/null device nodes located directly on root get copied over to my 
backup root as well, instead of the devtmpfs content otherwise over-
mounted on /dev.)

That principle of over-mount obscuring what's beneath it should apply to 
the ioctls as well.  They will always communicate with the top mounted 
layers.  To communicate with anything underneath, the over-mounting 
layers will either need umounted, or (if it's not the exact same 
mountpoint, which might have been your point) a bind-mount of the under-
mount can be used.

But an over-mount obscuring under-mounts is how Linux (and I believe POSIX 
in general) normally works.  (The semi-transparent union-filesystem 
solutions mentioned above thus being exceptions with those exceptions 
being the hairy bits, that explaining the several implementations with 
their various limitations and bugs.)  So not being able to access under-
mounts is the normal state of affairs. =:^)

-- 
Duncan - List replies preferred.   No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master."  Richard Stallman


  reply	other threads:[~2014-02-11 20:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-11  8:18 btrfs multiple mounts stacked on the same mount point Anand Jain
2014-02-11 20:57 ` Duncan [this message]
2014-02-12  3:37   ` Anand Jain
2014-02-12  5:15     ` Duncan
2014-02-12  7:36       ` Anand Jain
2014-02-12 13:17         ` Duncan

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='pan$9211b$42bef7b0$dd1350ae$978558c5@cox.net' \
    --to=1i5t5.duncan@cox.net \
    --cc=linux-btrfs@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;
as well as URLs for NNTP newsgroup(s).