Quoting Christian Seiler (christ...@iwakd.de):
...
> +             /* Read-only bind-mounting... In older kernels, doing that 
> required
> +              * to do one MS_BIND mount and then MS_REMOUNT|MS_RDONLY the 
> same
> +              * one. According to mount(2) manpage, MS_BIND honors MS_RDONLY 
> from
> +              * kernel 2.6.26 onwards. However, this apparently does not 
> work on
> +              * kernel 3.8.

I'm still not sure what is going on for you with this.  Running with the
latest 3.11 userns-enabled kernel (at ppa:ubuntu-lxc/kernel), I can
still do

        sudo mkdir /tmp/{a,b}
        sudo mount -t tmpfs tmpfs /tmp/a
        sudo mount --bind /tmp/a /tmp/b
        sudo mount -o remount,bind,ro /tmp/b

and end up with /tmp/b roand /tmp/a rw.  This works for me in 3.2, 3.8,
and userns-enabled 3.11.

> Unfortunately, on that very same kernel, doing the
> +              * same trick as above doesn't seem to work either, there one 
> needs
> +              * to ALSO specify MS_BIND for the remount, otherwise the entire
> +              * fs is remounted read-only or the mount fails because it's 
> busy...

That's actually understandable - there are two things which both have
a readonly.vs.readwrite state - the vfsmount, and the superblock.  If
you don't add MS_BIND, then you are requesting remount of the
superblock.

-serge

------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Lxc-devel mailing list
Lxc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/lxc-devel

Reply via email to