kernel-hacking-2024-linux-s.../fs
Chuck Lever f45663ce5f NFS: Allow either strict or sloppy mount option parsing
The kernel's NFS client mount option parser currently doesn't allow
unrecognized or incorrect mount options.  This prevents misspellings or
incorrectly specified mount options from possibly causing silent data
corruption.

However, NFS mount options are not standardized, so different operating
systems can use differently spelled mount options to support similar
features, or can support mount options which no other operating system
supports.

"Sloppy" mount option parsing, which allows the parser to ignore any
option it doesn't recognize, is needed to support automounters that often
use maps that are shared between heterogenous operating systems.

The legacy mount command ignores the validity of the values of mount
options entirely, except for the "sec=" and "proto=" options.  If an
incorrect value is specified, the out-of-range value is passed to the
kernel; if a value is specified that contains non-numeric characters,
it appears as though the legacy mount command sets that option to zero
(probably incorrect behavior in general).

In any case, this sets a precedent which we will partially follow for
the kernel mount option parser:

	+ if "sloppy" is not set, the parser will be strict about both
	  unrecognized options (same as legacy) and invalid option
	  values (stricter than legacy)

	+ if "sloppy" is set, the parser will ignore unrecognized
	  options and invalid option values (same as legacy)

An "invalid" option value in this case means that either the type
(integer, short, or string) or sign (for integer values) of the specified
value is incorrect.

This patch does two things: it changes the NFS client's mount option
parsing loop so that it parses the whole string instead of failing at
the first unrecognized option or invalid option value.  An unrecognized
option or an invalid option value cause the option to be skipped.

Then, the patch adds a "sloppy" mount option that allows the parsing
to succeed anyway if there were any problems during parsing.  When
parsing a set of options is complete, if there are errors and "sloppy"
was specified, return success anyway.  Otherwise, only return success
if there are no errors.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
2008-07-09 12:09:44 -04:00
..
9p 9p: fix O_APPEND in legacy mode 2008-07-03 09:59:03 -05:00
adfs
affs [PATCH] fix reservation discarding in affs 2008-05-06 13:45:33 -04:00
afs Fix various old email addresses for dwmw2 2008-06-06 11:29:10 -07:00
autofs
autofs4
befs byteorder: don't directly include linux/byteorder/generic.h 2008-05-16 12:01:45 -07:00
bfs
cifs Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 2008-06-11 09:45:51 -07:00
coda
configfs
cramfs
debugfs
devpts
dlm dlm: fix plock dev_write return value 2008-05-19 15:37:27 -05:00
ecryptfs ecryptfs: remove unnecessary mux from ecryptfs_init_ecryptfs_miscdev() 2008-07-04 10:40:05 -07:00
efs
exportfs
ext2
ext3 ext3: add missing unlock to error path in ext3_quota_write() 2008-07-04 10:40:05 -07:00
ext4 ext4: add missing unlock to an error path in ext4_quota_write() 2008-07-04 10:40:05 -07:00
fat fat: relax the permission check of fat_setattr() 2008-06-12 18:05:39 -07:00
freevxfs
fuse fuse: fix thinko in max I/O size calucation 2008-06-17 18:08:10 -07:00
gfs2 [GFS2] fix gfs2 block allocation (cleaned up) 2008-06-24 19:02:28 +01:00
hfs
hfsplus Fix hfsplus oops on image without extents 2008-05-13 08:02:24 -07:00
hostfs
hpfs
hppfs fix hppfs Makefile breakage 2008-05-21 16:55:58 -07:00
hugetlbfs
isofs
jbd jbd: need to hold j_state_lock to updates to transaction t_state to T_COMMIT 2008-05-14 19:11:14 -07:00
jbd2 jbd2: Fix barrier fallback code to re-lock the buffer head 2008-06-03 22:31:11 -04:00
jffs2
jfs
lockd
minix
msdos
ncpfs
nfs NFS: Allow either strict or sloppy mount option parsing 2008-07-09 12:09:44 -04:00
nfs_common
nfsd rpc: bring back cl_chatty 2008-07-09 12:09:10 -04:00
nls
ntfs ntfs: le*_add_cpu conversion 2008-05-24 09:56:08 -07:00
ocfs2 ocfs2: Remove ->hangup() from stack glue operations. 2008-06-16 10:46:52 -07:00
openpromfs
partitions
proc Fix pagemap_read() use of struct mm_walk 2008-07-05 13:13:44 -07:00
qnx4
ramfs
reiserfs reiserfs: discard prealloc in reiserfs_delete_inode 2008-07-08 12:39:31 -07:00
romfs
smbfs
sysfs sysfs: remove error messages for -EEXIST case 2008-05-14 22:34:16 -07:00
sysv
udf udf: Fix regression in UDF anchor block detection 2008-06-24 11:38:03 +02:00
ufs ufs: remove unneeded ufs_put_inode prototype 2008-05-13 08:02:23 -07:00
vfat
xfs [XFS] Fix memory corruption with small buffer reads 2008-05-23 18:12:49 +10:00
aio.c uml: activate_mm: remove the dead PF_BORROWED_MM check 2008-06-06 11:36:22 -07:00
anon_inodes.c
attr.c
bad_inode.c
binfmt_aout.c
binfmt_elf.c Remove last traces of a.out support from ELF loader. 2008-06-16 10:20:57 -07:00
binfmt_elf_fdpic.c nommu: fix ksize() abuse 2008-06-06 11:29:13 -07:00
binfmt_em86.c
binfmt_flat.c nommu: fix ksize() abuse 2008-06-06 11:29:13 -07:00
binfmt_misc.c
binfmt_script.c
binfmt_som.c
bio.c docbook: fix bio missing parameter 2008-05-07 18:35:03 +02:00
block_dev.c [PATCH] fix cgroup-inflicted breakage in block_dev.c 2008-06-23 08:30:55 -04:00
buffer.c Properly notify block layer of sync writes 2008-07-01 09:07:34 +02:00
char_dev.c
compat.c [PATCH] get rid of leak in compat_execve() 2008-05-16 17:23:05 -04:00
compat_binfmt_elf.c
compat_ioctl.c
dcache.c [patch 2/3] vfs: dcache cleanups 2008-06-23 13:07:00 -04:00
dcookies.c
direct-io.c
dnotify.c
dquot.c quota: don't call sync_fs() from vfs_quota_off() when there's no quota turn off 2008-05-13 08:02:23 -07:00
drop_caches.c
eventfd.c
eventpoll.c
exec.c Include <asm/a.out.h> in fs/exec.c only for Alpha. 2008-06-16 10:20:57 -07:00
fcntl.c
fifo.c
file.c [PATCH] avoid multiplication overflows and signedness issues for max_fds 2008-05-16 17:22:52 -04:00
file_table.c
filesystems.c
fs-writeback.c
generic_acl.c
inode.c VFS: fix unused variable warning 2008-05-06 13:13:37 -07:00
inotify.c
inotify_user.c
internal.h
ioctl.c
ioprio.c
Kconfig SUNRPC: Use only rpcbind v2 for AF_INET requests 2008-07-09 12:09:37 -04:00
Kconfig.binfmt frv: don't offer BINFMT_FLAT 2008-06-06 11:29:08 -07:00
libfs.c add kernel-doc for simple_read_from_buffer and memory_read_from_buffer 2008-07-04 10:40:07 -07:00
locks.c [patch 4/4] flock: remove unused fields from file_lock_operations 2008-06-23 11:52:30 -04:00
Makefile
mbcache.c
mpage.c
namei.c [patch 3/4] vfs: fix ERR_PTR abuse in generic_readlink 2008-06-23 11:52:30 -04:00
namespace.c
nfsctl.c
no-block.c
open.c security: filesystem capabilities: fix fragile setuid fixup code 2008-07-04 10:40:08 -07:00
pipe.c [patch 1/4] vfs: path_{get,put}() cleanups 2008-06-23 11:52:29 -04:00
pnode.c
pnode.h
posix_acl.c
quota.c
quota_v1.c
quota_v2.c
read_write.c
read_write.h
readdir.c
select.c Fix performance regression on lmbench select benchmark 2008-06-22 12:23:15 -07:00
seq_file.c
signalfd.c
splice.c splice: handle try_to_release_page() failure 2008-05-28 14:49:27 +02:00
stack.c
stat.c
super.c
sync.c
timerfd.c
utimes.c [patch for 2.6.26 4/4] vfs: utimensat(): fix write access check for futimens() 2008-06-23 08:43:52 -04:00
xattr.c
xattr_acl.c