From: Miklos Szeredi <miklos@szeredi.hu>
To: akpm@linux-foundation.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org
Cc: Steve French <sfrench@us.ibm.com>,
Lachlan McIlroy <lachlan@sgi.com>,
"Josef 'Jeff' Sipek" <jsipek@cs.sunysb.edu>,
Russell King <rmk@arm.linux.org.uk>,
Roman Zippel <zippel@linux-m68k.org>,
David Howells <dhowells@redhat.com>, Ian Kent <raven@themaw.net>,
"Sergey S. Kostyliov" <rathamahata@php4.ru>,
Karsten Keil <kkeil@suse.de>, "H. Peter Anvin" <hpa@zytor.com>,
"Theodore Ts'o" <tytso@MIT.EDU>,
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>,
Jeff Dike <jdike@addtoit.com>,
Mikulas Patocka <mikulas@artax.karlin.mff.cuni.cz>,
William Irwin <wli@holomorphy.com>,
Dave Kleikamp <shaggy@austin.ibm.com>,
Petr Vandrovec <vandrove@vc.cvut.cz>,
Trond Myklebust <Trond.Myklebust@netapp.com>,
Jeff Mahoney <jeffm@suse.com>, Paul Mackerras <paulus@samba.org>,
Hugh Dickins <hugh@veritas.com>,
Cyrill Gorcunov <gorcunov@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: [patch 01/26] mount options: add documentation
Date: Thu, 24 Jan 2008 20:33:42 +0100 [thread overview]
Message-ID: <20080124193416.379218079@szeredi.hu> (raw)
In-Reply-To: <20080124193341.166753833@szeredi.hu>
[-- Attachment #1: fs_options_doc.patch --]
[-- Type: text/plain, Size: 7091 bytes --]
From: Miklos Szeredi <mszeredi@suse.cz>
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, they have been
compile tested only. I would like to ask maintainers (CC-d on
respective patches) to please review, test and ACK these changes.
The following filesystems still need fixing: CIFS, NFS, XFS, Unionfs,
Reiser4. For CIFS, NFS and XFS I wasn't able to understand how some
of the options are used. The last two are not yet in mainline, so I
leave fixing those to their respective maintainers out of pure
laziness.
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
most - fs defines ->show_options(), and shows most of them
good - fs shows all options
noopt - fs does not have options
patch - a patch will be posted
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 patch
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 patch
minix noopt
msdos ->fat
ncpfs patch
nfs patch,most
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 most
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) patch
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 none
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
This patch:
Document the rules for handling mount options in the .show_options
super operation.
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
---
Index: linux/Documentation/filesystems/vfs.txt
===================================================================
--- linux.orig/Documentation/filesystems/vfs.txt 2008-01-24 11:42:48.000000000 +0100
+++ linux/Documentation/filesystems/vfs.txt 2008-01-24 17:12:25.000000000 +0100
@@ -151,7 +151,7 @@ The get_sb() method has the following ar
const char *dev_name: the device name we are mounting.
void *data: arbitrary mount options, usually comes as an ASCII
- string
+ string (see "Mount Options" section)
struct vfsmount *mnt: a vfs-internal representation of a mount point
@@ -182,7 +182,7 @@ A fill_super() method implementation has
must initialize this properly.
void *data: arbitrary mount options, usually comes as an ASCII
- string
+ string (see "Mount Options" section)
int silent: whether or not to be silent on error
@@ -291,7 +291,8 @@ or bottom half).
umount_begin: called when the VFS is unmounting a filesystem.
- show_options: called by the VFS to show mount options for /proc/<pid>/mounts.
+ show_options: called by the VFS to show mount options for
+ /proc/<pid>/mounts. (see "Mount Options" section)
quota_read: called by the VFS to read from filesystem quota file.
@@ -969,6 +970,45 @@ manipulate dentries:
For further information on dentry locking, please refer to the document
Documentation/filesystems/dentry-locking.txt.
+Mount Options
+=============
+
+Parsing options
+---------------
+
+On mount and remount the filesystem is passed a string containing a
+comma separated list of mount options. The options can have either of
+these forms:
+
+ option
+ option=value
+
+The <linux/parser.h> header defines an API that helps parse these
+options. There are plenty of examples on how to use it in existing
+filesystems.
+
+Showing options
+---------------
+
+If a filesystem accepts mount options, it must define show_options()
+to show all the currently active options. The rules are:
+
+ - options MUST be shown which are not default or their values differ
+ from the default
+
+ - options MAY be shown which are enabled by default or have their
+ default value
+
+Options used only internally between a mount helper and the kernel
+(such as file descriptors), or which only have an effect during the
+mounting (such as ones controlling the creation of a journal) are exempt
+from the above rules.
+
+A simple method of saving options at mount/remount time and showing
+them is provided with the save_mount_options() and
+generic_show_options() helper functions. Please note, that using
+these may have drawbacks. For more info see header comments for these
+functions in fs/namespace.c.
Resources
=========
--
next prev parent reply other threads:[~2008-01-24 19:38 UTC|newest]
Thread overview: 79+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-01-24 19:33 [patch 00/26] mount options: fix filesystem's ->show_options Miklos Szeredi
2008-01-24 19:33 ` Miklos Szeredi [this message]
2008-01-25 0:24 ` [patch 01/26] mount options: add documentation Erez Zadok
2008-01-25 7:56 ` David Chinner
2008-01-25 10:02 ` Miklos Szeredi
2008-01-30 1:54 ` Roman Zippel
2008-01-30 9:09 ` Miklos Szeredi
2008-01-30 14:42 ` Karel Zak
2008-01-31 17:42 ` Miklos Szeredi
2008-02-08 19:20 ` Roman Zippel
2008-02-08 20:23 ` Miklos Szeredi
2008-01-24 19:33 ` [patch 02/26] mount options: add generic_show_options() Miklos Szeredi
2008-01-24 19:33 ` [patch 03/26] mount options: fix adfs Miklos Szeredi
2008-01-24 20:05 ` Russell King
2008-01-24 19:33 ` [patch 04/26] mount options: fix affs Miklos Szeredi
2008-01-24 19:33 ` [patch 05/26] mount options: fix afs Miklos Szeredi
2008-01-24 19:33 ` [patch 06/26] mount options: fix autofs4 Miklos Szeredi
2008-01-25 5:13 ` Ian Kent
2008-01-24 19:33 ` [patch 07/26] mount options: fix autofs Miklos Szeredi
2008-01-24 19:46 ` H. Peter Anvin
2008-01-24 19:33 ` [patch 08/26] mount options: fix befs Miklos Szeredi
2008-01-24 19:33 ` [patch 09/26] mount options: fix capifs Miklos Szeredi
2008-01-25 10:18 ` Karsten Keil
2008-01-24 19:33 ` [patch 10/26] mount options: fix devpts Miklos Szeredi
2008-01-24 19:46 ` H. Peter Anvin
2008-01-25 9:24 ` Miklos Szeredi
2008-01-24 19:33 ` [patch 11/26] mount options: fix ext2 Miklos Szeredi
2008-01-25 14:34 ` Jan Kara
2008-01-24 19:33 ` [patch 12/26] mount options: fix ext4 Miklos Szeredi
2008-01-25 6:41 ` Andreas Dilger
2008-01-25 14:37 ` Jan Kara
2008-01-25 17:35 ` Mingming Cao
2008-01-24 19:33 ` [patch 13/26] mount options: fix fat Miklos Szeredi
2008-01-24 19:33 ` [patch 14/26] mount options: fix fuse Miklos Szeredi
2008-01-24 19:33 ` [patch 15/26] mount options: fix hostfs Miklos Szeredi
2008-01-24 19:33 ` [patch 16/26] mount options: fix hpfs Miklos Szeredi
2008-01-24 19:33 ` [patch 17/26] mount options: fix hugetlbfs Miklos Szeredi
2008-01-24 19:33 ` [patch 18/26] mount options: fix isofs Miklos Szeredi
2008-01-25 14:42 ` Jan Kara
2008-01-24 19:34 ` [patch 19/26] mount options: fix jfs Miklos Szeredi
2008-01-24 21:15 ` Dave Kleikamp
2008-01-24 21:57 ` Andrew Morton
2008-01-24 22:17 ` Dave Kleikamp
2008-01-24 19:34 ` [patch 20/26] mount options: fix ncpfs Miklos Szeredi
2008-01-24 19:34 ` [patch 21/26] mount options: partially fix nfs Miklos Szeredi
2008-01-24 20:49 ` Chuck Lever
2008-01-25 9:39 ` Miklos Szeredi
2008-01-25 17:19 ` Chuck Lever
2008-01-28 11:34 ` Miklos Szeredi
2008-01-28 16:22 ` Chuck Lever
2008-01-24 20:53 ` Trond Myklebust
2008-01-25 9:43 ` Miklos Szeredi
2008-01-24 19:34 ` [patch 22/26] mount options: fix reiserfs Miklos Szeredi
2008-01-24 19:34 ` [patch 23/26] mount options: fix spufs Miklos Szeredi
2008-01-24 19:34 ` [patch 24/26] mount options: fix tmpfs Miklos Szeredi
2008-01-28 6:09 ` Hugh Dickins
2008-01-28 11:40 ` Miklos Szeredi
2008-01-29 13:28 ` Hugh Dickins
2008-01-24 19:34 ` [patch 25/26] mount options: fix udf Miklos Szeredi
2008-01-24 19:51 ` Cyrill Gorcunov
2008-01-24 20:20 ` Cyrill Gorcunov
2008-01-25 9:29 ` Miklos Szeredi
2008-01-25 10:57 ` Cyrill Gorcunov
2008-01-25 13:41 ` Cyrill Gorcunov
2008-01-25 15:27 ` Jan Kara
2008-01-25 15:50 ` Miklos Szeredi
2008-01-25 15:57 ` Cyrill Gorcunov
2008-01-25 16:07 ` Jan Kara
2008-01-25 16:10 ` Miklos Szeredi
2008-01-24 20:40 ` Cyrill Gorcunov
2008-01-25 15:30 ` Jan Kara
2008-01-25 15:56 ` Miklos Szeredi
2008-01-25 16:04 ` Jan Kara
2008-01-24 19:34 ` [patch 26/26] mount options: fix usbfs Miklos Szeredi
2008-01-24 22:01 ` Greg KH
2008-01-25 9:54 ` Miklos Szeredi
2008-01-27 6:01 ` [patch 00/26] mount options: fix filesystem's ->show_options Andrew Morton
2008-01-28 11:36 ` Miklos Szeredi
2008-01-29 0:19 ` [patch 05/26] mount options: fix afs David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080124193416.379218079@szeredi.hu \
--to=miklos@szeredi.hu \
--cc=Trond.Myklebust@netapp.com \
--cc=akpm@linux-foundation.org \
--cc=dhowells@redhat.com \
--cc=gorcunov@gmail.com \
--cc=gregkh@suse.de \
--cc=hirofumi@mail.parknet.co.jp \
--cc=hpa@zytor.com \
--cc=hugh@veritas.com \
--cc=jdike@addtoit.com \
--cc=jeffm@suse.com \
--cc=jsipek@cs.sunysb.edu \
--cc=kkeil@suse.de \
--cc=lachlan@sgi.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mikulas@artax.karlin.mff.cuni.cz \
--cc=paulus@samba.org \
--cc=rathamahata@php4.ru \
--cc=raven@themaw.net \
--cc=rmk@arm.linux.org.uk \
--cc=sfrench@us.ibm.com \
--cc=shaggy@austin.ibm.com \
--cc=tytso@MIT.EDU \
--cc=vandrove@vc.cvut.cz \
--cc=wli@holomorphy.com \
--cc=zippel@linux-m68k.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®