Read-only bind mounts
Get series with b4
b4 am 20070920195249.852667D5@kernelVersions newest first
- v1 Latest25 patches 21 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/25 | filesystem helpers for custom 'struct file'sfs/ fs/ fs/ +5 more | +104 | 0 replies | |
| 2/25 | rearrange may_open() to be r/o friendlyfs/ | +4 | 0 replies | |
| 3/25 | give may_open() a local 'mnt' variablefs/ | +5 | 1 reply | |
| 4/25 | create cleanup helper svc_msnfs()fs/ | +11 | 0 replies | |
| 5/25 | r/o bind mounts: stub functionsfs/ include/ | +57 | 0 replies | |
| 6/25 | elevate write count open()'d filesfs/ fs/ ipc/ | +27 | 2 replies | |
| 7/25 | r/o bind mounts: elevate write count for some ioctlsfs/ fs/ fs/ +8 more | +274 | 6 replies | |
| 8/25 | elevate writer count for chown and friendsfs/ | +30 | 0 replies | |
| 9/25 | make access() use mnt checkfs/ | +11 | 0 replies | |
| 10/25 | elevate mnt writers for callers of vfs_mkdir()fs/ fs/ | +9 | 0 replies | |
| 11/25 | elevate write count during entire ncp_ioctl()fs/ | +53 | 0 replies | |
| 12/25 | elevate write count for link and symlink callsfs/ | +10 | 0 replies | |
| 13/25 | elevate mount count for extended attributesfs/ fs/ | +20 | 0 replies | |
| 14/25 | elevate write count for file_update_time()fs/ | +12 | 0 replies | |
| 15/25 | unix_find_other() elevate write count for touch_atime()net/ | +12 | 0 replies | |
| 16/25 | elevate write count over calls to vfs_rename()fs/ fs/ | +15 | 0 replies | |
| 17/25 | nfs: check mnt instead of superblock directlyfs/ fs/ | +4 | 0 replies | |
| 18/25 | elevate writer count for do_sys_truncate()fs/ | +8 | 0 replies | |
| 19/25 | elevate write count for do_utimes()fs/ | +9 | 0 replies | |
| 20/25 | elevate write count for do_sys_utime() and touch_atime()fs/ | +12 | 0 replies | |
| 21/25 | sys_mknodat(): elevate write count for vfs_mknod/create()fs/ fs/ net/ | +29 | 0 replies | |
| 22/25 | elevate mnt writers for vfs_unlink() callersfs/ ipc/ | +8 | 0 replies | |
| 23/25 | do_rmdir(): elevate write countfs/ | +5 | 0 replies | |
| 24/25 | r/o bind mounts: track number of mount writersfs/ include/ | +198 | 13 replies | |
| 25/25 | honor r/w changes at do_remount() timefs/ include/ | +40 | 0 replies |
Reviews trailers per patch
18 of 25 patches have a Reviewed-by or Acked-by.
| Patch | Christoph Hellwig |
|---|---|
| 1/25 | |
| 2/25 | |
| 3/25 | |
| 4/25 | A-b |
| 5/25 | |
| 6/25 | A-b |
| 7/25 | A-b |
| 8/25 | A-b |
| 9/25 | A-b |
| 10/25 | A-b |
| 11/25 | |
| 12/25 | A-b |
| 13/25 | A-b |
| 14/25 | A-b |
| 15/25 | A-b |
| 16/25 | A-b |
| 17/25 | A-b |
| 18/25 | A-b |
| 19/25 | A-b |
| 20/25 | A-b |
| 21/25 | A-b |
| 22/25 | A-b |
| 23/25 | A-b |
| 24/25 | |
| 25/25 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH 00/25] Read-only bind mounts
This is against 2.6.23-rc6. Compared to 2.6.23-rc6-mm1, there are a few (trivial) merge conflicts with the audit git tree, and one slightly more complicated one with ext2-reservations.patch.
Changes from last post:
- added several kerneldoc comments for exported functions
- broke out the 'mnt' variable patch
- removed WARN_ON() in ioctl patch
The first four patches here are very simple cleanups, and can go in ahead of the rest of the patches.
If you are reviewing this, the things that need the most review are the last two patches that actually add the logic for tracking mount write counts.
---
Why do we need r/o bind mounts?
This feature allows a read-only view into a read-write filesystem. In the process of doing that, it also provides infrastructure for keeping track of the number of writers to any given mount.
This has a number of uses. It allows chroots to have parts of filesystems writable. It will be useful for containers in the future because users may have root inside a container, but should not be allowed to write to somefilesystems. This also replaces patches that vserver has had out of the tree for several years.
It allows security enhancement by making sure that parts of your filesystem read-only (such as when you don't trust your FTP server), when you don't want to have entire new filesystems mounted, or when you want atime selectively updated. I've been using the following script to test that the feature is working as desired. It takes a directory and makes a regular bind and a r/o bind mount of it. It then performs some normal filesystem operations on the three directories, including ones that are expected to fail, like creating a file on the r/o mount.