aboutsummaryrefslogtreecommitdiffstats
path: root/Documentation
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2008-02-08 07:21:34 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-08 12:22:39 -0500
commitf84e3f521e1449300e0fdc314b7b43b418a66dc3 (patch)
treea74cfd2dfb32bc0d4d5299737055c3d0027164f9 /Documentation
parente542059884bb6d651d7ffc64eacedbab2b64078c (diff)
mount options: add documentation
This series addresses the problem of showing mount options in /proc/mounts. Several filesystems which use mount options, have not implemented a .show_options superblock operation. Several others have implemented this callback, but have not kept it fully up to date with the parsed options. Q: Why do we need correct option showing in /proc/mounts? A: We want /proc/mounts to fully replace /etc/mtab. The reasons for this are: - unprivileged mounters won't be able to update /etc/mtab - /etc/mtab doesn't work with private mount namespaces - /etc/mtab can become out-of-sync with reality Q: Can't this be done, so that filesystems need not bother with implementing a .show_mounts callback, and keeping it up to date? A: Only in some cases. Certain filesystems allow modification of a subset of options in their remount_fs method. It is not possible to take this into account without knowing exactly how the filesystem handles options. For the simple case (no remount or remount resets all options) the patchset introduces two helpers: generic_show_options() save_mount_options() These can also be used to emulate the old /etc/mtab behavior, until proper support is added. Even if this is not 100% correct, it's still better than showing no options at all. The following patches fix up most in-tree filesystems, some have been compile tested only, some have been reviewed and acked by the maintainer. Table displaying status of all in-kernel filesystems: - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - legend: none - fs has options, but doesn't define ->show_options() some - fs defines ->show_options(), but some only options are shown good - fs shows all options noopt - fs does not have options patch - a patch will be posted merged - a patch has been merged by subsystem maintainer 9p good adfs patch affs patch afs patch autofs patch autofs4 patch befs patch bfs noopt cifs some coda noopt configfs noopt cramfs noopt debugfs noopt devpts patch ecryptfs good efs noopt ext2 patch ext3 good ext4 merged fat patch freevxfs noopt fuse patch fusectl noopt gfs2 good gfs2meta noopt hfs good hfsplus good hostfs patch hpfs patch hppfs noopt hugetlbfs patch isofs patch jffs2 noopt jfs merged minix noopt msdos ->fat ncpfs patch nfs some nfsd noopt ntfs good ocfs2 good ocfs2/dlmfs noopt openpromfs noopt proc noopt qnx4 noopt ramfs noopt reiserfs patch romfs noopt smbfs good sysfs noopt sysv noopt udf patch ufs good vfat ->fat xfs good mm/shmem.c patch drivers/oprofile/oprofilefs.c noopt drivers/infiniband/hw/ipath/ipath_fs.c noopt drivers/misc/ibmasm/ibmasmfs.c noopt drivers/usb/core (usbfs) merged drivers/usb/gadget (gadgetfs) noopt drivers/isdn/capi/capifs.c patch kernel/cpuset.c noopt fs/binfmt_misc.c noopt net/sunrpc/rpc_pipe.c noopt arch/powerpc/platforms/cell/spufs patch arch/s390/hypfs good ipc/mqueue.c noopt security (securityfs) noopt security/selinux/selinuxfs.c noopt kernel/cgroup.c good security/smack/smackfs.c noopt in -mm: reiser4 some unionfs good - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This patch: Document the rules for handling mount options in the .show_options super operation. Signed-off-by: Miklos Szeredi <mszeredi@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'Documentation')
-rw-r--r--Documentation/filesystems/vfs.txt50
1 files changed, 47 insertions, 3 deletions
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
index bd55038b56f5..81e5be6e6e35 100644
--- a/Documentation/filesystems/vfs.txt
+++ b/Documentation/filesystems/vfs.txt
@@ -151,7 +151,7 @@ The get_sb() method has the following arguments:
151 const char *dev_name: the device name we are mounting. 151 const char *dev_name: the device name we are mounting.
152 152
153 void *data: arbitrary mount options, usually comes as an ASCII 153 void *data: arbitrary mount options, usually comes as an ASCII
154 string 154 string (see "Mount Options" section)
155 155
156 struct vfsmount *mnt: a vfs-internal representation of a mount point 156 struct vfsmount *mnt: a vfs-internal representation of a mount point
157 157
@@ -182,7 +182,7 @@ A fill_super() method implementation has the following arguments:
182 must initialize this properly. 182 must initialize this properly.
183 183
184 void *data: arbitrary mount options, usually comes as an ASCII 184 void *data: arbitrary mount options, usually comes as an ASCII
185 string 185 string (see "Mount Options" section)
186 186
187 int silent: whether or not to be silent on error 187 int silent: whether or not to be silent on error
188 188
@@ -291,7 +291,8 @@ or bottom half).
291 291
292 umount_begin: called when the VFS is unmounting a filesystem. 292 umount_begin: called when the VFS is unmounting a filesystem.
293 293
294 show_options: called by the VFS to show mount options for /proc/<pid>/mounts. 294 show_options: called by the VFS to show mount options for
295 /proc/<pid>/mounts. (see "Mount Options" section)
295 296
296 quota_read: called by the VFS to read from filesystem quota file. 297 quota_read: called by the VFS to read from filesystem quota file.
297 298
@@ -969,6 +970,49 @@ manipulate dentries:
969For further information on dentry locking, please refer to the document 970For further information on dentry locking, please refer to the document
970Documentation/filesystems/dentry-locking.txt. 971Documentation/filesystems/dentry-locking.txt.
971 972
973Mount Options
974=============
975
976Parsing options
977---------------
978
979On mount and remount the filesystem is passed a string containing a
980comma separated list of mount options. The options can have either of
981these forms:
982
983 option
984 option=value
985
986The <linux/parser.h> header defines an API that helps parse these
987options. There are plenty of examples on how to use it in existing
988filesystems.
989
990Showing options
991---------------
992
993If a filesystem accepts mount options, it must define show_options()
994to show all the currently active options. The rules are:
995
996 - options MUST be shown which are not default or their values differ
997 from the default
998
999 - options MAY be shown which are enabled by default or have their
1000 default value
1001
1002Options used only internally between a mount helper and the kernel
1003(such as file descriptors), or which only have an effect during the
1004mounting (such as ones controlling the creation of a journal) are exempt
1005from the above rules.
1006
1007The underlying reason for the above rules is to make sure, that a
1008mount can be accurately replicated (e.g. umounting and mounting again)
1009based on the information found in /proc/mounts.
1010
1011A simple method of saving options at mount/remount time and showing
1012them is provided with the save_mount_options() and
1013generic_show_options() helper functions. Please note, that using
1014these may have drawbacks. For more info see header comments for these
1015functions in fs/namespace.c.
972 1016
973Resources 1017Resources
974========= 1018=========