Re: unshare -m and mount propagation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Apr 18, 2016 at 04:05:29PM +0300, Yuriy M. Kaminskiy wrote:
> On 18.04.2016 15:22, Karel Zak wrote:
> > On Mon, Apr 18, 2016 at 02:51:37PM +0300, Yuriy M. Kaminskiy wrote:
> > > Karel Zak <kzak@xxxxxxxxxx> writes:
> > > 
> > > > On Fri, Mar 18, 2016 at 05:26:25AM +0300, Yuriy M. Kaminskiy wrote:
> > > > > I think this issue should be at least documented. And, maybe, default
> > > > > `--propagation` should be changed to `slave`.
> > > > 
> > > > The reason why we use 'private' is that it's the kernel default for
> > > > years and it's what has been expected by users for long time before we
> > > > introduced --propagation and any unshare(1) default.
> > > > 
> > > > The current --propagation default unifies things and makes unshare(1)
> > > > portable to distributions where root fs is mounted as 'shared' (e.g.
> > > > systemd distros) and all this in backwardly compatible way for users
> 
> Opposite. It does not change anything for older systems, but breaks things
> for new systems.
> 
> > > > who have no clue about --propagation.
> 
> And it is *especially* harmful for users that are not aware about
> --propagation. As private (new 2.27+ default) break umount propagation, and
> results in nasty surprises (up to data loss).

Well, you see only umount propagation... 

The problem is that the original implementation (try emulate by
"--propagation unchanged") makes "unshare --mount" useless at all on
systems with shared root fs.

The very old (since year 2009) and very common use-case is:

 # unshare --mount
 # mount /dev/foo /mnt

and user expects that /mnt will be visible *only* in the session
(namespace). This is the way how many users use unshare for years.

Unfortunately, after systemd installation it does not work anymore
and /mnt is visible everywhere. For users it's regression and it has
been reported many many times.

You can blame systemd, but the problem is that unshare(1) was not
robust enough. So we have forced unshare to use "private" by default
to keep the *original behavior* independently on root fs propagation
flag.

    Karel

-- 
 Karel Zak  <kzak@xxxxxxxxxx>
 http://karelzak.blogspot.com
--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux