diff options
Diffstat (limited to 'fs/nfsd/nfsctl.c')
-rw-r--r-- | fs/nfsd/nfsctl.c | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index 7046ac9cf97f..d6881774ea57 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -35,8 +35,6 @@ | |||
35 | 35 | ||
36 | #include <asm/uaccess.h> | 36 | #include <asm/uaccess.h> |
37 | 37 | ||
38 | unsigned int nfsd_versbits = ~0; | ||
39 | |||
40 | /* | 38 | /* |
41 | * We have a single directory with 9 nodes in it. | 39 | * We have a single directory with 9 nodes in it. |
42 | */ | 40 | */ |
@@ -372,6 +370,10 @@ static ssize_t write_versions(struct file *file, char *buf, size_t size) | |||
372 | 370 | ||
373 | if (size>0) { | 371 | if (size>0) { |
374 | if (nfsd_serv) | 372 | if (nfsd_serv) |
373 | /* Cannot change versions without updating | ||
374 | * nfsd_serv->sv_xdrsize, and reallocing | ||
375 | * rq_argp and rq_resp | ||
376 | */ | ||
375 | return -EBUSY; | 377 | return -EBUSY; |
376 | if (buf[size-1] != '\n') | 378 | if (buf[size-1] != '\n') |
377 | return -EINVAL; | 379 | return -EINVAL; |
@@ -390,10 +392,7 @@ static ssize_t write_versions(struct file *file, char *buf, size_t size) | |||
390 | case 2: | 392 | case 2: |
391 | case 3: | 393 | case 3: |
392 | case 4: | 394 | case 4: |
393 | if (sign != '-') | 395 | nfsd_vers(num, sign == '-' ? NFSD_CLEAR : NFSD_SET); |
394 | NFSCTL_VERSET(nfsd_versbits, num); | ||
395 | else | ||
396 | NFSCTL_VERUNSET(nfsd_versbits, num); | ||
397 | break; | 396 | break; |
398 | default: | 397 | default: |
399 | return -EINVAL; | 398 | return -EINVAL; |
@@ -404,16 +403,15 @@ static ssize_t write_versions(struct file *file, char *buf, size_t size) | |||
404 | /* If all get turned off, turn them back on, as | 403 | /* If all get turned off, turn them back on, as |
405 | * having no versions is BAD | 404 | * having no versions is BAD |
406 | */ | 405 | */ |
407 | if ((nfsd_versbits & NFSCTL_VERALL)==0) | 406 | nfsd_reset_versions(); |
408 | nfsd_versbits = NFSCTL_VERALL; | ||
409 | } | 407 | } |
410 | /* Now write current state into reply buffer */ | 408 | /* Now write current state into reply buffer */ |
411 | len = 0; | 409 | len = 0; |
412 | sep = ""; | 410 | sep = ""; |
413 | for (num=2 ; num <= 4 ; num++) | 411 | for (num=2 ; num <= 4 ; num++) |
414 | if (NFSCTL_VERISSET(NFSCTL_VERALL, num)) { | 412 | if (nfsd_vers(num, NFSD_AVAIL)) { |
415 | len += sprintf(buf+len, "%s%c%d", sep, | 413 | len += sprintf(buf+len, "%s%c%d", sep, |
416 | NFSCTL_VERISSET(nfsd_versbits, num)?'+':'-', | 414 | nfsd_vers(num, NFSD_TEST)?'+':'-', |
417 | num); | 415 | num); |
418 | sep = " "; | 416 | sep = " "; |
419 | } | 417 | } |