diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 19:39:11 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-09-11 19:39:11 -0400 |
commit | 86d710146fb9975f04c505ec78caa43d227c1018 (patch) | |
tree | c7f95412b7760e6b7e3c15eab8b2ac944256d7ac /fs/nfs/callback.c | |
parent | 86373435d2299b722ec87c416005953215f049c1 (diff) | |
parent | ab3bbaa8b257845e248e9a01d12a69ca245f4197 (diff) |
Merge git://git.linux-nfs.org/projects/trondmy/nfs-2.6
* git://git.linux-nfs.org/projects/trondmy/nfs-2.6: (87 commits)
NFSv4: Disallow 'mount -t nfs4 -overs=2' and 'mount -t nfs4 -overs=3'
NFS: Allow the "nfs" file system type to support NFSv4
NFS: Move details of nfs4_get_sb() to a helper
NFS: Refactor NFSv4 text-based mount option validation
NFS: Mount option parser should detect missing "port="
NFS: out of date comment regarding O_EXCL above nfs3_proc_create()
NFS: Handle a zero-length auth flavor list
SUNRPC: Ensure that sunrpc gets initialised before nfs, lockd, etc...
nfs: fix compile error in rpc_pipefs.h
nfs: Remove reference to generic_osync_inode from a comment
SUNRPC: cache must take a reference to the cache detail's module on open()
NFS: Use the DNS resolver in the mount code.
NFS: Add a dns resolver for use with NFSv4 referrals and migration
SUNRPC: Fix a typo in cache_pipefs_files
nfs: nfs4xdr: optimize low level decoding
nfs: nfs4xdr: get rid of READ_BUF
nfs: nfs4xdr: simplify decode_exchange_id by reusing decode_opaque_inline
nfs: nfs4xdr: get rid of COPYMEM
nfs: nfs4xdr: introduce decode_sessionid helper
nfs: nfs4xdr: introduce decode_verifier helper
...
Diffstat (limited to 'fs/nfs/callback.c')
-rw-r--r-- | fs/nfs/callback.c | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/fs/nfs/callback.c b/fs/nfs/callback.c index 7f604c7941fb..293fa0528a6e 100644 --- a/fs/nfs/callback.c +++ b/fs/nfs/callback.c | |||
@@ -43,21 +43,29 @@ static struct svc_program nfs4_callback_program; | |||
43 | unsigned int nfs_callback_set_tcpport; | 43 | unsigned int nfs_callback_set_tcpport; |
44 | unsigned short nfs_callback_tcpport; | 44 | unsigned short nfs_callback_tcpport; |
45 | unsigned short nfs_callback_tcpport6; | 45 | unsigned short nfs_callback_tcpport6; |
46 | static const int nfs_set_port_min = 0; | 46 | #define NFS_CALLBACK_MAXPORTNR (65535U) |
47 | static const int nfs_set_port_max = 65535; | ||
48 | 47 | ||
49 | static int param_set_port(const char *val, struct kernel_param *kp) | 48 | static int param_set_portnr(const char *val, struct kernel_param *kp) |
50 | { | 49 | { |
51 | char *endp; | 50 | unsigned long num; |
52 | int num = simple_strtol(val, &endp, 0); | 51 | int ret; |
53 | if (endp == val || *endp || num < nfs_set_port_min || num > nfs_set_port_max) | 52 | |
53 | if (!val) | ||
54 | return -EINVAL; | ||
55 | ret = strict_strtoul(val, 0, &num); | ||
56 | if (ret == -EINVAL || num > NFS_CALLBACK_MAXPORTNR) | ||
54 | return -EINVAL; | 57 | return -EINVAL; |
55 | *((int *)kp->arg) = num; | 58 | *((unsigned int *)kp->arg) = num; |
56 | return 0; | 59 | return 0; |
57 | } | 60 | } |
58 | 61 | ||
59 | module_param_call(callback_tcpport, param_set_port, param_get_int, | 62 | static int param_get_portnr(char *buffer, struct kernel_param *kp) |
60 | &nfs_callback_set_tcpport, 0644); | 63 | { |
64 | return param_get_uint(buffer, kp); | ||
65 | } | ||
66 | #define param_check_portnr(name, p) __param_check(name, p, unsigned int); | ||
67 | |||
68 | module_param_named(callback_tcpport, nfs_callback_set_tcpport, portnr, 0644); | ||
61 | 69 | ||
62 | /* | 70 | /* |
63 | * This is the NFSv4 callback kernel thread. | 71 | * This is the NFSv4 callback kernel thread. |