Mount writer count and read-only bind mounts
Get series with b4
b4 am 20070622200303.82D9CC3A@kernelVersions newest first
- v1 Latest26 patches 56 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/26 | document nlink functioninclude/ | +27 | 1 reply | |
| 2/26 | ext3: remove extra IS_RDONLY() checkfs/ | +1 | 1 reply | |
| 3/26 | ext4: remove extra IS_RDONLY() checkfs/ | +1 | 1 reply | |
| 4/26 | filesystem helpers for custom 'struct file'sfs/ fs/ fs/ +6 more | +81 | 7 replies | |
| 5/26 | r/o bind mounts: stub functionsfs/ include/ | +26 | 3 replies | |
| 6/26 | elevate write count open()'d filesfs/ fs/ ipc/ | +27 | 2 replies | |
| 7/26 | r/o bind mounts: elevate write count for some ioctlsfs/ fs/ fs/ +8 more | +272 | 1 reply | |
| 8/26 | elevate writer count for chown and friendsfs/ | +30 | 1 reply | |
| 9/26 | make access() use mnt checkfs/ | +1 | 5 replies | |
| 10/26 | elevate mnt writers for callers of vfs_mkdir()fs/ fs/ | +9 | 1 reply | |
| 11/26 | elevate write count during entire ncp_ioctl()fs/ | +54 | 0 replies | |
| 12/26 | elevate write count for link and symlink callsfs/ | +10 | 0 replies | |
| 13/26 | elevate mount count for extended attributesfs/ fs/ | +20 | 0 replies | |
| 14/26 | elevate write count for file_update_time()fs/ | +6 | 4 replies | |
| 15/26 | mount_is_safe(): add commentfs/ | +4 | 2 replies | |
| 16/26 | unix_find_other() elevate write count for touch_atime()net/ | +12 | 1 reply | |
| 17/26 | elevate write count over calls to vfs_rename()fs/ fs/ | +23 | 1 reply | |
| 18/26 | nfs: check mnt instead of superblock directlyfs/ fs/ | +4 | 1 reply | |
| 19/26 | elevate writer count for do_sys_truncate()fs/ | +9 | 1 reply | |
| 20/26 | elevate write count for do_utimes()fs/ | +16 | 1 reply | |
| 21/26 | elevate write count for do_sys_utime() and touch_atime()fs/ | +12 | 1 reply | |
| 22/26 | sys_mknodat(): elevate write count for vfs_mknod/create()fs/ fs/ net/ | +22 | 9 replies | |
| 23/26 | elevate mnt writers for vfs_unlink() callersfs/ ipc/ | +8 | 1 reply | |
| 24/26 | do_rmdir(): elevate write countfs/ | +5 | 1 reply | |
| 25/26 | r/o bind mounts: scalable writer countfs/ fs/ include/ | +150 | 6 replies | |
| 26/26 | honor r/w changes at do_remount() timefs/ include/ | +40 | 1 reply |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [PATCH 00/26] Mount writer count and read-only bind mounts
The largest change from last time is in patch 25/26. It has been reworked to use per-cpu lock instead of a per-node one. See the patch for more details.
I would also appreciate any close review of patch 08/27. It touches a lot of code, and I'm a bit worried that a buglet or two could have snuck in there.
Note that there are a few stragglers left using IS_RDONLY() in reiser4 and in some other low-level filesystem code. The reiser4 asserts should be just fine left the way they are, plus reiser4 needs quite a bit of work before merging anyway. The ntfs usage appears to be internal, and not related to user activity.
This patch survives running ltp as well as a home-grown set of filesystem operations here:
http://sr71.net/~dave/linux/robind-test.sh
---
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.