Bug 15739
Summary: | readonly attribute of a bind mount is not preserved across bind mounts. | ||
---|---|---|---|
Product: | File System | Reporter: | Tefnet developers (developers) |
Component: | VFS | Assignee: | Marshel Abraham (marshel.abraham) |
Status: | CLOSED PATCH_ALREADY_AVAILABLE | ||
Severity: | normal | CC: | marshel.abraham |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 2.6.31 | Subsystem: | |
Regression: | No | Bisected commit-id: |
Description
Tefnet developers
2010-04-09 14:38:21 UTC
This issue seems to be solved in the latest kernel. Remember 2.6 onwards kernel doesnt support to bind mount a rw file system to ro, the first step itself doesnt work in my kernel. root@host:/# mount 1 2 -o bind,ro mount: warning: 2 seems to be mounted read-write. http://lwn.net/Articles/281157/ Besides that the filesystem subdirectories tend to retain their properties... In your case /2 is ro, But /2/11 is rw having inherited from 1/11 So 2/11 which is rw when bind mounted to /3 retains the rw... Can this issue be closed...? Thanks for the update, it seems more reasonable now: root@klocek:/tmp/bindtest# mkdir -p 1/11 2 3 root@klocek:/tmp/bindtest# mount 1 2 -o bind,ro mount: warning: 2 seems to be mounted read-write. root@klocek:/tmp/bindtest# mount 2 -o remount,ro root@klocek:/tmp/bindtest# touch 2/foo touch: cannot touch `2/foo': Read-only file system root@klocek:/tmp/bindtest# mount 2/11 3 -o bind,rw mount: warning: 3 seems to be mounted read-only. root@klocek:/tmp/bindtest# touch 3/foo touch: cannot touch `3/foo': Read-only file system root@klocek:/tmp/bindtest# The original problem I had with that (unexpected write possibilities) does not seem to occur anymore, so I think that the issue can be closed :). Can somebody close this..? |