CrOS Kernel 3.14.0
Device: minnie
What steps will reproduce the problem?
In CrOS:
localhost ~ # mkdir /tmp/test
localhost ~ # mount -t tmpfs none /tmp/test
localhost ~ # cd /tmp/test
localhost test # mkdir a b
localhost test # mount --bind a b
localhost test # mount -o remount,ro b
localhost test # touch hoge
What is the expected output? What do you see instead?
I expect touch command succeeds, but actually it fails with following error:
touch: cannot touch 'hoge': Read-only file system
Actually, while I expect only /tmp/test/b is mounted read-only, /tmp/test also gets remounted read-only.
localhost test # mount
...
none on /tmp/test type tmpfs (ro,relatime,seclabel)
none on /tmp/test/b type tmpfs (ro,relatime,seclabel)
According to man mount(8) and https://lwn.net/Articles/281157/ , setting bind-mount read-only has been supported since 2.6.26, and in fact "-o remount,ro" works as expected in my workstation (running Ubuntu w/ kernel 3.13). I think this issue is specific to Chrome OS kernel.
Comment 1 by uekawa@chromium.org
, Feb 29 2016