New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 590682 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Feb 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 2
Type: Bug



Sign in to add a comment

Read-only remount of bind mount propagates to source filesystem

Project Member Reported by nya@chromium.org, Feb 29 2016

Issue description

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

Expected, try:

# mount -o remount,bind,ro b

instead.
as linked in the article you reference https://lwn.net/Articles/637501/


and manpage which documents the behavior when /etc/mtab does not exist (or is symlinked to /proc/mounts as 
is on CrOS that does not document the 'bind' flag)
 

Comment 2 by nya@chromium.org, Feb 29 2016

Status: WontFix (was: Untriaged)
Oh, thanks, -o remount,bind worked. I dismissed the part in manpage...

Sign in to add a comment