Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 322809 - mount -o ro --bind /foo /bar : says mounted read-only but is writeable, and no warnings or errors!
Summary: mount -o ro --bind /foo /bar : says mounted read-only but is writeable, and n...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-05 00:21 UTC by Nicolas Roome
Modified: 2010-06-07 03:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nicolas Roome 2010-06-05 00:21:11 UTC
When using the 'mount' command with the -o ro and --bind options the command completes successfully, does not generate any errors or messages, and according to 'mount' the mount is a bind and is read-only.  According to /proc/mounts the results are different, and as read-write.  Despite 'mount' saying read-only, you can write to the mount.

Reproducible: Always

Steps to Reproduce:
1. mount -o ro --bind /foo /bar
2. mount (and check the entry, it says "(ro,bind)")
3. cat /proc/mounts
4. touch /bar/test
5. ls /bar/test

Actual Results:  
The mount is read-write

Expected Results:  
The mount should either:

A) give a warning saying the mount is read-write (as is done in Ubuntu and Fedora)
or;
B) mount in true read-only
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2010-06-06 23:17:08 UTC
From mount(8):

              Note that the filesystem mount options will remain the  same  as
              those  on  the  original  mount  point, and cannot be changed by
              passing the -o option along with --bind/--rbind.
Comment 2 Nicolas Roome 2010-06-06 23:22:48 UTC
(In reply to comment #1)
> From mount(8):
> 
>               Note that the filesystem mount options will remain the  same  as
>               those  on  the  original  mount  point, and cannot be changed by
>               passing the -o option along with --bind/--rbind.
> 

I dont feel this is an invalid bug.  According to the paragraph, the mount --bind should mount a read-write system as read-write.  Why is it I am able to mount it read-only (according to 'mount') and write to it?  Mount should not be saying that it is mounted as read-only when it isnt.
Comment 3 Michael Weber (RETIRED) gentoo-dev 2010-06-07 03:46:40 UTC
Hello Nicolas,

i think Jeroen tried to say that this isn't a Gentoo specific bug.
And mount behaves like specified in the manual, only the mount output is wrong.
(in general, watch the difference between /etc/mtab and /proc/mounts, the first might be garbage on ro but is printed by mount afaik)

Please consider filing a bug upstream, the ebuilds lists http://www.kernel.org/pub/linux/utils/util-linux-ng/ as a homepage, http://www.kernel.org/pub/linux/utils/util-linux-ng/README lists http://userweb.kernel.org/~kzak/util-linux-ng/ , (which is a bug in the ebuild). they have a mailinglist+archive for bug tracking.

Michael