RFC Read-only bind mounts
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest27 patches 27 repliesIn review
Patches in v1 No applies recorded yet
Reviews trailers per patch
3 of 27 patches have a Reviewed-by or Acked-by.
| Patch | Herbert Poetzl |
|---|---|
| 1/27 | |
| 2/27 | A-b |
| 3/27 | |
| 4/27 | |
| 5/27 | |
| 6/27 | |
| 7/27 | |
| 8/27 | A-b |
| 9/27 | |
| 10/27 | |
| 11/27 | A-b |
| 12/27 | |
| 13/27 | |
| 14/27 | |
| 15/27 | |
| 16/27 | |
| 17/27 | |
| 18/27 | |
| 19/27 | |
| 20/27 | |
| 21/27 | |
| 22/27 | |
| 23/27 | |
| 24/27 | |
| 25/27 | |
| 26/27 | |
| 27/27 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [RFC][PATCH 00/27] Read-only bind mounts
The following series implements read-only bind mounts. This set does not take the previously tried approach of pushing down the vfsmount structure deeply into call paths, such that it might be checked in functions like permission(), may_create() and may_open(). Instead, it does checks near the entry points in the kernel, bumping a reference count in the vfsmount structure and effetively holding a kind of a lock on the vfsmount.
This approach will come in handy in the future, allowing transitions from rw to ro mounts while guaranteeing that no writers are currently active.
I apologize for so many small patches, but breaking them up like this really did help me find bugs. A rollup is here:
http://sr71.net/~dave/patches/ro-bind-mounts-06-07-2006.patch
This series passes a test I got from Herbert Poetzl, checking to see that these r/o bind mounts have the same properties as regular r/o device mounts for a number of syscalls.
http://vserver.13thfloor.at/Experimental/BME/fstest-0.03.tar.bz2
Here is the script I used to generate and compare the output from that test:
#!/bin/sh
{ umount ro-bind-mount ro-mount;
rm -rf ro-mount-source ro-bind-mount-source ro-mount ro-bind-mount; dd if=/dev/zero of=ro-mount-source count=10000; mkfs.ext3 -F ro-mount-source;
mkdir ro-mount ro-bind-mount;
mkdir ro-bind-mount-source
} > /dev/null 2>&1
mount --bind -o ro ro-bind-mount-source ro-bind-mount mount -t ext3 -o loop,ro ro-mount-source ro-mount
function fstest_and_diff
{
ARG1="$1"
shift
ARG2="$1"
./fstest -d "$ARG1" > "$ARG1".log;
./fstest -d "$ARG2" > "$ARG2".log;
diff -ru "$ARG1".log "$ARG2".log
}fstest_and_diff ro-mount ro-bind-mount
umount ro-bind-mount ro-mount