aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r--fs/nfsd/nfsctl.c22
1 files changed, 13 insertions, 9 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c
index 8516137cdbb0..613bcb8171a5 100644
--- a/fs/nfsd/nfsctl.c
+++ b/fs/nfsd/nfsctl.c
@@ -37,6 +37,7 @@
37#include <linux/nfsd/syscall.h> 37#include <linux/nfsd/syscall.h>
38 38
39#include <asm/uaccess.h> 39#include <asm/uaccess.h>
40#include <net/ipv6.h>
40 41
41/* 42/*
42 * We have a single directory with 9 nodes in it. 43 * We have a single directory with 9 nodes in it.
@@ -149,7 +150,6 @@ static const struct file_operations transaction_ops = {
149 .release = simple_transaction_release, 150 .release = simple_transaction_release,
150}; 151};
151 152
152extern struct seq_operations nfs_exports_op;
153static int exports_open(struct inode *inode, struct file *file) 153static int exports_open(struct inode *inode, struct file *file)
154{ 154{
155 return seq_open(file, &nfs_exports_op); 155 return seq_open(file, &nfs_exports_op);
@@ -222,6 +222,7 @@ static ssize_t write_getfs(struct file *file, char *buf, size_t size)
222 struct auth_domain *clp; 222 struct auth_domain *clp;
223 int err = 0; 223 int err = 0;
224 struct knfsd_fh *res; 224 struct knfsd_fh *res;
225 struct in6_addr in6;
225 226
226 if (size < sizeof(*data)) 227 if (size < sizeof(*data))
227 return -EINVAL; 228 return -EINVAL;
@@ -236,7 +237,11 @@ static ssize_t write_getfs(struct file *file, char *buf, size_t size)
236 res = (struct knfsd_fh*)buf; 237 res = (struct knfsd_fh*)buf;
237 238
238 exp_readlock(); 239 exp_readlock();
239 if (!(clp = auth_unix_lookup(sin->sin_addr))) 240
241 ipv6_addr_set_v4mapped(sin->sin_addr.s_addr, &in6);
242
243 clp = auth_unix_lookup(&in6);
244 if (!clp)
240 err = -EPERM; 245 err = -EPERM;
241 else { 246 else {
242 err = exp_rootfh(clp, data->gd_path, res, data->gd_maxlen); 247 err = exp_rootfh(clp, data->gd_path, res, data->gd_maxlen);
@@ -257,6 +262,7 @@ static ssize_t write_getfd(struct file *file, char *buf, size_t size)
257 int err = 0; 262 int err = 0;
258 struct knfsd_fh fh; 263 struct knfsd_fh fh;
259 char *res; 264 char *res;
265 struct in6_addr in6;
260 266
261 if (size < sizeof(*data)) 267 if (size < sizeof(*data))
262 return -EINVAL; 268 return -EINVAL;
@@ -271,7 +277,11 @@ static ssize_t write_getfd(struct file *file, char *buf, size_t size)
271 res = buf; 277 res = buf;
272 sin = (struct sockaddr_in *)&data->gd_addr; 278 sin = (struct sockaddr_in *)&data->gd_addr;
273 exp_readlock(); 279 exp_readlock();
274 if (!(clp = auth_unix_lookup(sin->sin_addr))) 280
281 ipv6_addr_set_v4mapped(sin->sin_addr.s_addr, &in6);
282
283 clp = auth_unix_lookup(&in6);
284 if (!clp)
275 err = -EPERM; 285 err = -EPERM;
276 else { 286 else {
277 err = exp_rootfh(clp, data->gd_path, &fh, NFS_FHSIZE); 287 err = exp_rootfh(clp, data->gd_path, &fh, NFS_FHSIZE);
@@ -347,8 +357,6 @@ static ssize_t write_filehandle(struct file *file, char *buf, size_t size)
347 return mesg - buf; 357 return mesg - buf;
348} 358}
349 359
350extern int nfsd_nrthreads(void);
351
352static ssize_t write_threads(struct file *file, char *buf, size_t size) 360static ssize_t write_threads(struct file *file, char *buf, size_t size)
353{ 361{
354 /* if size > 0, look for a number of threads and call nfsd_svc 362 /* if size > 0, look for a number of threads and call nfsd_svc
@@ -371,10 +379,6 @@ static ssize_t write_threads(struct file *file, char *buf, size_t size)
371 return strlen(buf); 379 return strlen(buf);
372} 380}
373 381
374extern int nfsd_nrpools(void);
375extern int nfsd_get_nrthreads(int n, int *);
376extern int nfsd_set_nrthreads(int n, int *);
377
378static ssize_t write_pool_threads(struct file *file, char *buf, size_t size) 382static ssize_t write_pool_threads(struct file *file, char *buf, size_t size)
379{ 383{
380 /* if size > 0, look for an array of number of threads per node 384 /* if size > 0, look for an array of number of threads per node