linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC][PATCH 00/27] Read-only bind mounts
@ 2006-06-08  0:10 Dave Hansen
  2006-06-08  0:10 ` [RFC][PATCH 01/27] Add vfsmount writer count Dave Hansen
                   ` (26 more replies)
  0 siblings, 27 replies; 55+ messages in thread
From: Dave Hansen @ 2006-06-08  0:10 UTC (permalink / raw)
  To: linux-fsdevel; +Cc: herbert, viro, hch, trond.myklebust, Dave Hansen

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

Signed-off-by: Dave Hansen <haveblue@us.ibm.com>

^ permalink raw reply	[flat|nested] 55+ messages in thread

end of thread, other threads:[~2006-06-12 19:03 UTC | newest]

Thread overview: 55+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-08  0:10 [RFC][PATCH 00/27] Read-only bind mounts Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 01/27] Add vfsmount writer count Dave Hansen
2006-06-08 10:33   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 02/27] vfs_rmdir: change if() into goto Dave Hansen
2006-06-08 10:37   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 04/27] elevate mnt writers for vfs_unlink() callers Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 03/27] do_rmdir(): elevate write count Dave Hansen
2006-06-08 10:42   ` Herbert Poetzl
2006-06-08 15:04     ` Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 05/27] elevate mnt writers for nfsd caller of vfs_mkdir() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 06/27] elevate write count during entire ncp_ioctl() Dave Hansen
2006-06-08 10:44   ` Herbert Poetzl
2006-06-08 15:07     ` Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 07/27] sys_mkdirat(): collapse if() Dave Hansen
2006-06-08 10:46   ` Herbert Poetzl
2006-06-08 15:10     ` Dave Hansen
2006-06-08 15:54       ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 09/27] elevate mnt writers for sys_mkdirat() call of vfs_mkdir() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 08/27] sys_mkdirat(): one more goto Dave Hansen
2006-06-08 10:48   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 10/27] sys_symlinkat() collapse if()s Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 11/27] sys_symlinkat() collapse one more if () Dave Hansen
2006-06-08 10:49   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 13/27] sys_linkat(): elevate write count around vfs_link() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 12/27] sys_symlinkat() elevate write count around vfs_symlink() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 14/27] tricky: elevate write count files are open()ed Dave Hansen
2006-06-08 10:54   ` Herbert Poetzl
2006-06-08 15:12     ` Dave Hansen
2006-06-08 16:07       ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 15/27] elevate writer count for do_sys_truncate() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 16/27] elevate write count for do_sys_utime() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 17/27] elevate write count for do_utimes() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 19/27] sys_faccessat() elevate writer count Dave Hansen
2006-06-08 11:03   ` Herbert Poetzl
2006-06-08 15:15     ` Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 18/27] sys_faccessat(): collapse if() Dave Hansen
2006-06-08 11:05   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 20/27] unix_find_other() elevate write count for touch_atime() Dave Hansen
2006-06-08 11:07   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 21/27] mount_is_safe(): add comment Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 22/27] sys_mknodat(): elevate write count for vfs_mknod/create() Dave Hansen
2006-06-08 11:16   ` Herbert Poetzl
2006-06-08 15:23     ` Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 23/27] elevate write count over calls to vfs_rename() Dave Hansen
2006-06-08 11:23   ` Herbert Poetzl
2006-06-08 15:24     ` Dave Hansen
2006-06-12 18:18   ` Al Viro
2006-06-12 18:29     ` Dave Hansen
2006-06-12 19:03       ` Al Viro
2006-06-08  0:10 ` [RFC][PATCH 24/27] elevate mount count for extended attributes Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 25/27] /proc/mounts: prep for flags from sb or mnt Dave Hansen
2006-06-08 11:25   ` Herbert Poetzl
2006-06-08  0:10 ` [RFC][PATCH 27/27] create and pass read-only mnt flag into do_loopback() Dave Hansen
2006-06-08  0:10 ` [RFC][PATCH 26/27] /proc/mounts: treat ro/rw like the rest Dave Hansen
2006-06-08 11:26   ` Herbert Poetzl

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).