]> git.baikalelectronics.ru Git - kernel.git/commit
NFS: More "sloppy" parsing problems
authorChuck Lever <chuck.lever@oracle.com>
Thu, 18 Jun 2009 01:02:14 +0000 (18:02 -0700)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Thu, 18 Jun 2009 01:02:14 +0000 (18:02 -0700)
commita3bbc6fe7e2d204f652d82a0d726a084c01558fa
treedbd8012bbba334e92edae060806eebc73d4338ad
parent822bd90fff2a98cef68cb187dc4655238f5d80fc
NFS: More "sloppy" parsing problems

Specifying "port=-5" with the kernel's current mount option parser
generates "unrecognized mount option".  If "sloppy" is set, this
causes the mount to succeed and use the default values; the desired
behavior is that, since this is a valid option with an invalid value,
the mount should fail, even with "sloppy."

To properly handle "sloppy" parsing, we need to distinguish between
correct options with invalid values, and incorrect options.  We will
need to parse integer values by hand, therefore, and not rely on
match_token().

For instance, these must all fail with "invalid value":

port=12345678
port=-5
port=samuel

and not with "unrecognized option," as they do currently.

Thus, for the sake of match_token() we need to treat the values for
these options as strings, and do the conversion to integers using
strict_strtol().

This is basically the same solution we used for the earlier "retry="
fix (commit 0176376a), except in this case the kernel actually has to
parse the value, rather than ignore it.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
fs/nfs/super.c