diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-24 10:46:05 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-04-24 10:46:05 -0400 |
commit | 860448cf76c0878b83d3cf343a0436188b396b8e (patch) | |
tree | 1f060525644c1f4405258cb9e3dd5c1d66c119f7 /fs | |
parent | ba0e4ae88f0f71b42ad8734e0c371d321554f13b (diff) | |
parent | bff175238a2416110e2258989c462234baeb5f46 (diff) |
Merge branch 'for-4.1' of git://linux-nfs.org/~bfields/linux
Pull nfsd updates from Bruce Fields:
"A quiet cycle this time; this is basically entirely bugfixes.
The few that aren't cc'd to stable are cleanup or seemed unlikely to
affect anyone much"
* 'for-4.1' of git://linux-nfs.org/~bfields/linux:
uapi: Remove kernel internal declaration
nfsd: fix nsfd startup race triggering BUG_ON
nfsd: eliminate NFSD_DEBUG
nfsd4: fix READ permission checking
nfsd4: disallow SEEK with special stateids
nfsd4: disallow ALLOCATE with special stateids
nfsd: add NFSEXP_PNFS to the exflags array
nfsd: Remove duplicate macro define for max sec label length
nfsd: allow setting acls with unenforceable DENYs
nfsd: NFSD_FAULT_INJECTION depends on DEBUG_FS
nfsd: remove unused status arg to nfsd4_cleanup_open_state
nfsd: remove bogus setting of status in nfsd4_process_open2
NFSD: Use correct reply size calculating function
NFSD: Using path_equal() for checking two paths
Diffstat (limited to 'fs')
-rw-r--r-- | fs/lockd/svcsubs.c | 2 | ||||
-rw-r--r-- | fs/nfsd/Kconfig | 2 | ||||
-rw-r--r-- | fs/nfsd/export.c | 4 | ||||
-rw-r--r-- | fs/nfsd/nfs4acl.c | 50 | ||||
-rw-r--r-- | fs/nfsd/nfs4proc.c | 12 | ||||
-rw-r--r-- | fs/nfsd/nfs4state.c | 5 | ||||
-rw-r--r-- | fs/nfsd/nfs4xdr.c | 16 | ||||
-rw-r--r-- | fs/nfsd/nfsctl.c | 16 | ||||
-rw-r--r-- | fs/nfsd/nfsd.h | 2 | ||||
-rw-r--r-- | fs/nfsd/xdr4.h | 3 |
10 files changed, 35 insertions, 77 deletions
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index 665ef5a05183..a563ddbc19e6 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c | |||
@@ -31,7 +31,7 @@ | |||
31 | static struct hlist_head nlm_files[FILE_NRHASH]; | 31 | static struct hlist_head nlm_files[FILE_NRHASH]; |
32 | static DEFINE_MUTEX(nlm_file_mutex); | 32 | static DEFINE_MUTEX(nlm_file_mutex); |
33 | 33 | ||
34 | #ifdef NFSD_DEBUG | 34 | #ifdef CONFIG_SUNRPC_DEBUG |
35 | static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f) | 35 | static inline void nlm_debug_print_fh(char *msg, struct nfs_fh *f) |
36 | { | 36 | { |
37 | u32 *fhp = (u32*)f->data; | 37 | u32 *fhp = (u32*)f->data; |
diff --git a/fs/nfsd/Kconfig b/fs/nfsd/Kconfig index fc2d108f5272..a0b77fc1bd39 100644 --- a/fs/nfsd/Kconfig +++ b/fs/nfsd/Kconfig | |||
@@ -108,7 +108,7 @@ config NFSD_V4_SECURITY_LABEL | |||
108 | 108 | ||
109 | config NFSD_FAULT_INJECTION | 109 | config NFSD_FAULT_INJECTION |
110 | bool "NFS server manual fault injection" | 110 | bool "NFS server manual fault injection" |
111 | depends on NFSD_V4 && DEBUG_KERNEL | 111 | depends on NFSD_V4 && DEBUG_KERNEL && DEBUG_FS |
112 | help | 112 | help |
113 | This option enables support for manually injecting faults | 113 | This option enables support for manually injecting faults |
114 | into the NFS server. This is intended to be used for | 114 | into the NFS server. This is intended to be used for |
diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index c3e3b6e55ae2..900c3ae94adc 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c | |||
@@ -691,8 +691,7 @@ static int svc_export_match(struct cache_head *a, struct cache_head *b) | |||
691 | struct svc_export *orig = container_of(a, struct svc_export, h); | 691 | struct svc_export *orig = container_of(a, struct svc_export, h); |
692 | struct svc_export *new = container_of(b, struct svc_export, h); | 692 | struct svc_export *new = container_of(b, struct svc_export, h); |
693 | return orig->ex_client == new->ex_client && | 693 | return orig->ex_client == new->ex_client && |
694 | orig->ex_path.dentry == new->ex_path.dentry && | 694 | path_equal(&orig->ex_path, &new->ex_path); |
695 | orig->ex_path.mnt == new->ex_path.mnt; | ||
696 | } | 695 | } |
697 | 696 | ||
698 | static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) | 697 | static void svc_export_init(struct cache_head *cnew, struct cache_head *citem) |
@@ -1159,6 +1158,7 @@ static struct flags { | |||
1159 | { NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}}, | 1158 | { NFSEXP_NOSUBTREECHECK, {"no_subtree_check", ""}}, |
1160 | { NFSEXP_NOAUTHNLM, {"insecure_locks", ""}}, | 1159 | { NFSEXP_NOAUTHNLM, {"insecure_locks", ""}}, |
1161 | { NFSEXP_V4ROOT, {"v4root", ""}}, | 1160 | { NFSEXP_V4ROOT, {"v4root", ""}}, |
1161 | { NFSEXP_PNFS, {"pnfs", ""}}, | ||
1162 | { 0, {"", ""}} | 1162 | { 0, {"", ""}} |
1163 | }; | 1163 | }; |
1164 | 1164 | ||
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index 59fd76651781..eaf4605a4b9e 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c | |||
@@ -499,43 +499,13 @@ static inline void add_to_mask(struct posix_acl_state *state, struct posix_ace_s | |||
499 | state->mask.allow |= astate->allow; | 499 | state->mask.allow |= astate->allow; |
500 | } | 500 | } |
501 | 501 | ||
502 | /* | ||
503 | * Certain bits (SYNCHRONIZE, DELETE, WRITE_OWNER, READ/WRITE_NAMED_ATTRS, | ||
504 | * READ_ATTRIBUTES, READ_ACL) are currently unenforceable and don't translate | ||
505 | * to traditional read/write/execute permissions. | ||
506 | * | ||
507 | * It's problematic to reject acls that use certain mode bits, because it | ||
508 | * places the burden on users to learn the rules about which bits one | ||
509 | * particular server sets, without giving the user a lot of help--we return an | ||
510 | * error that could mean any number of different things. To make matters | ||
511 | * worse, the problematic bits might be introduced by some application that's | ||
512 | * automatically mapping from some other acl model. | ||
513 | * | ||
514 | * So wherever possible we accept anything, possibly erring on the side of | ||
515 | * denying more permissions than necessary. | ||
516 | * | ||
517 | * However we do reject *explicit* DENY's of a few bits representing | ||
518 | * permissions we could never deny: | ||
519 | */ | ||
520 | |||
521 | static inline int check_deny(u32 mask, int isowner) | ||
522 | { | ||
523 | if (mask & (NFS4_ACE_READ_ATTRIBUTES | NFS4_ACE_READ_ACL)) | ||
524 | return -EINVAL; | ||
525 | if (!isowner) | ||
526 | return 0; | ||
527 | if (mask & (NFS4_ACE_WRITE_ATTRIBUTES | NFS4_ACE_WRITE_ACL)) | ||
528 | return -EINVAL; | ||
529 | return 0; | ||
530 | } | ||
531 | |||
532 | static struct posix_acl * | 502 | static struct posix_acl * |
533 | posix_state_to_acl(struct posix_acl_state *state, unsigned int flags) | 503 | posix_state_to_acl(struct posix_acl_state *state, unsigned int flags) |
534 | { | 504 | { |
535 | struct posix_acl_entry *pace; | 505 | struct posix_acl_entry *pace; |
536 | struct posix_acl *pacl; | 506 | struct posix_acl *pacl; |
537 | int nace; | 507 | int nace; |
538 | int i, error = 0; | 508 | int i; |
539 | 509 | ||
540 | /* | 510 | /* |
541 | * ACLs with no ACEs are treated differently in the inheritable | 511 | * ACLs with no ACEs are treated differently in the inheritable |
@@ -560,17 +530,11 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags) | |||
560 | 530 | ||
561 | pace = pacl->a_entries; | 531 | pace = pacl->a_entries; |
562 | pace->e_tag = ACL_USER_OBJ; | 532 | pace->e_tag = ACL_USER_OBJ; |
563 | error = check_deny(state->owner.deny, 1); | ||
564 | if (error) | ||
565 | goto out_err; | ||
566 | low_mode_from_nfs4(state->owner.allow, &pace->e_perm, flags); | 533 | low_mode_from_nfs4(state->owner.allow, &pace->e_perm, flags); |
567 | 534 | ||
568 | for (i=0; i < state->users->n; i++) { | 535 | for (i=0; i < state->users->n; i++) { |
569 | pace++; | 536 | pace++; |
570 | pace->e_tag = ACL_USER; | 537 | pace->e_tag = ACL_USER; |
571 | error = check_deny(state->users->aces[i].perms.deny, 0); | ||
572 | if (error) | ||
573 | goto out_err; | ||
574 | low_mode_from_nfs4(state->users->aces[i].perms.allow, | 538 | low_mode_from_nfs4(state->users->aces[i].perms.allow, |
575 | &pace->e_perm, flags); | 539 | &pace->e_perm, flags); |
576 | pace->e_uid = state->users->aces[i].uid; | 540 | pace->e_uid = state->users->aces[i].uid; |
@@ -579,18 +543,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags) | |||
579 | 543 | ||
580 | pace++; | 544 | pace++; |
581 | pace->e_tag = ACL_GROUP_OBJ; | 545 | pace->e_tag = ACL_GROUP_OBJ; |
582 | error = check_deny(state->group.deny, 0); | ||
583 | if (error) | ||
584 | goto out_err; | ||
585 | low_mode_from_nfs4(state->group.allow, &pace->e_perm, flags); | 546 | low_mode_from_nfs4(state->group.allow, &pace->e_perm, flags); |
586 | add_to_mask(state, &state->group); | 547 | add_to_mask(state, &state->group); |
587 | 548 | ||
588 | for (i=0; i < state->groups->n; i++) { | 549 | for (i=0; i < state->groups->n; i++) { |
589 | pace++; | 550 | pace++; |
590 | pace->e_tag = ACL_GROUP; | 551 | pace->e_tag = ACL_GROUP; |
591 | error = check_deny(state->groups->aces[i].perms.deny, 0); | ||
592 | if (error) | ||
593 | goto out_err; | ||
594 | low_mode_from_nfs4(state->groups->aces[i].perms.allow, | 552 | low_mode_from_nfs4(state->groups->aces[i].perms.allow, |
595 | &pace->e_perm, flags); | 553 | &pace->e_perm, flags); |
596 | pace->e_gid = state->groups->aces[i].gid; | 554 | pace->e_gid = state->groups->aces[i].gid; |
@@ -605,15 +563,9 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags) | |||
605 | 563 | ||
606 | pace++; | 564 | pace++; |
607 | pace->e_tag = ACL_OTHER; | 565 | pace->e_tag = ACL_OTHER; |
608 | error = check_deny(state->other.deny, 0); | ||
609 | if (error) | ||
610 | goto out_err; | ||
611 | low_mode_from_nfs4(state->other.allow, &pace->e_perm, flags); | 566 | low_mode_from_nfs4(state->other.allow, &pace->e_perm, flags); |
612 | 567 | ||
613 | return pacl; | 568 | return pacl; |
614 | out_err: | ||
615 | posix_acl_release(pacl); | ||
616 | return ERR_PTR(error); | ||
617 | } | 569 | } |
618 | 570 | ||
619 | static inline void allow_bits(struct posix_ace_state *astate, u32 mask) | 571 | static inline void allow_bits(struct posix_ace_state *astate, u32 mask) |
diff --git a/fs/nfsd/nfs4proc.c b/fs/nfsd/nfs4proc.c index 92b9d97aff4f..4a8314f08a0e 100644 --- a/fs/nfsd/nfs4proc.c +++ b/fs/nfsd/nfs4proc.c | |||
@@ -470,7 +470,7 @@ out: | |||
470 | fh_put(resfh); | 470 | fh_put(resfh); |
471 | kfree(resfh); | 471 | kfree(resfh); |
472 | } | 472 | } |
473 | nfsd4_cleanup_open_state(cstate, open, status); | 473 | nfsd4_cleanup_open_state(cstate, open); |
474 | nfsd4_bump_seqid(cstate, status); | 474 | nfsd4_bump_seqid(cstate, status); |
475 | return status; | 475 | return status; |
476 | } | 476 | } |
@@ -1030,6 +1030,8 @@ nfsd4_fallocate(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
1030 | dprintk("NFSD: nfsd4_fallocate: couldn't process stateid!\n"); | 1030 | dprintk("NFSD: nfsd4_fallocate: couldn't process stateid!\n"); |
1031 | return status; | 1031 | return status; |
1032 | } | 1032 | } |
1033 | if (!file) | ||
1034 | return nfserr_bad_stateid; | ||
1033 | 1035 | ||
1034 | status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file, | 1036 | status = nfsd4_vfs_fallocate(rqstp, &cstate->current_fh, file, |
1035 | fallocate->falloc_offset, | 1037 | fallocate->falloc_offset, |
@@ -1069,6 +1071,8 @@ nfsd4_seek(struct svc_rqst *rqstp, struct nfsd4_compound_state *cstate, | |||
1069 | dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n"); | 1071 | dprintk("NFSD: nfsd4_seek: couldn't process stateid!\n"); |
1070 | return status; | 1072 | return status; |
1071 | } | 1073 | } |
1074 | if (!file) | ||
1075 | return nfserr_bad_stateid; | ||
1072 | 1076 | ||
1073 | switch (seek->seek_whence) { | 1077 | switch (seek->seek_whence) { |
1074 | case NFS4_CONTENT_DATA: | 1078 | case NFS4_CONTENT_DATA: |
@@ -1815,7 +1819,7 @@ static inline u32 nfsd4_getattr_rsize(struct svc_rqst *rqstp, | |||
1815 | bmap0 &= ~FATTR4_WORD0_FILEHANDLE; | 1819 | bmap0 &= ~FATTR4_WORD0_FILEHANDLE; |
1816 | } | 1820 | } |
1817 | if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) { | 1821 | if (bmap2 & FATTR4_WORD2_SECURITY_LABEL) { |
1818 | ret += NFSD4_MAX_SEC_LABEL_LEN + 12; | 1822 | ret += NFS4_MAXLABELLEN + 12; |
1819 | bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL; | 1823 | bmap2 &= ~FATTR4_WORD2_SECURITY_LABEL; |
1820 | } | 1824 | } |
1821 | /* | 1825 | /* |
@@ -2282,13 +2286,13 @@ static struct nfsd4_operation nfsd4_ops[] = { | |||
2282 | .op_func = (nfsd4op_func)nfsd4_allocate, | 2286 | .op_func = (nfsd4op_func)nfsd4_allocate, |
2283 | .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, | 2287 | .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, |
2284 | .op_name = "OP_ALLOCATE", | 2288 | .op_name = "OP_ALLOCATE", |
2285 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize, | 2289 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, |
2286 | }, | 2290 | }, |
2287 | [OP_DEALLOCATE] = { | 2291 | [OP_DEALLOCATE] = { |
2288 | .op_func = (nfsd4op_func)nfsd4_deallocate, | 2292 | .op_func = (nfsd4op_func)nfsd4_deallocate, |
2289 | .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, | 2293 | .op_flags = OP_MODIFIES_SOMETHING | OP_CACHEME, |
2290 | .op_name = "OP_DEALLOCATE", | 2294 | .op_name = "OP_DEALLOCATE", |
2291 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_write_rsize, | 2295 | .op_rsize_bop = (nfsd4op_rsize)nfsd4_only_status_rsize, |
2292 | }, | 2296 | }, |
2293 | [OP_SEEK] = { | 2297 | [OP_SEEK] = { |
2294 | .op_func = (nfsd4op_func)nfsd4_seek, | 2298 | .op_func = (nfsd4op_func)nfsd4_seek, |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 326a545ea7b2..d42786ee39af 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -1139,7 +1139,7 @@ hash_sessionid(struct nfs4_sessionid *sessionid) | |||
1139 | return sid->sequence % SESSION_HASH_SIZE; | 1139 | return sid->sequence % SESSION_HASH_SIZE; |
1140 | } | 1140 | } |
1141 | 1141 | ||
1142 | #ifdef NFSD_DEBUG | 1142 | #ifdef CONFIG_SUNRPC_DEBUG |
1143 | static inline void | 1143 | static inline void |
1144 | dump_sessionid(const char *fn, struct nfs4_sessionid *sessionid) | 1144 | dump_sessionid(const char *fn, struct nfs4_sessionid *sessionid) |
1145 | { | 1145 | { |
@@ -4049,7 +4049,6 @@ nfsd4_process_open2(struct svc_rqst *rqstp, struct svc_fh *current_fh, struct nf | |||
4049 | status = nfserr_bad_stateid; | 4049 | status = nfserr_bad_stateid; |
4050 | if (nfsd4_is_deleg_cur(open)) | 4050 | if (nfsd4_is_deleg_cur(open)) |
4051 | goto out; | 4051 | goto out; |
4052 | status = nfserr_jukebox; | ||
4053 | } | 4052 | } |
4054 | 4053 | ||
4055 | /* | 4054 | /* |
@@ -4118,7 +4117,7 @@ out: | |||
4118 | } | 4117 | } |
4119 | 4118 | ||
4120 | void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate, | 4119 | void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate, |
4121 | struct nfsd4_open *open, __be32 status) | 4120 | struct nfsd4_open *open) |
4122 | { | 4121 | { |
4123 | if (open->op_openowner) { | 4122 | if (open->op_openowner) { |
4124 | struct nfs4_stateowner *so = &open->op_openowner->oo_owner; | 4123 | struct nfs4_stateowner *so = &open->op_openowner->oo_owner; |
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 5fb7e78169a6..a45032ce7b80 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -424,7 +424,7 @@ nfsd4_decode_fattr(struct nfsd4_compoundargs *argp, u32 *bmval, | |||
424 | len += 4; | 424 | len += 4; |
425 | dummy32 = be32_to_cpup(p++); | 425 | dummy32 = be32_to_cpup(p++); |
426 | READ_BUF(dummy32); | 426 | READ_BUF(dummy32); |
427 | if (dummy32 > NFSD4_MAX_SEC_LABEL_LEN) | 427 | if (dummy32 > NFS4_MAXLABELLEN) |
428 | return nfserr_badlabel; | 428 | return nfserr_badlabel; |
429 | len += (XDR_QUADLEN(dummy32) << 2); | 429 | len += (XDR_QUADLEN(dummy32) << 2); |
430 | READMEM(buf, dummy32); | 430 | READMEM(buf, dummy32); |
@@ -2020,7 +2020,7 @@ static __be32 nfsd4_encode_path(struct xdr_stream *xdr, | |||
2020 | * dentries/path components in an array. | 2020 | * dentries/path components in an array. |
2021 | */ | 2021 | */ |
2022 | for (;;) { | 2022 | for (;;) { |
2023 | if (cur.dentry == root->dentry && cur.mnt == root->mnt) | 2023 | if (path_equal(&cur, root)) |
2024 | break; | 2024 | break; |
2025 | if (cur.dentry == cur.mnt->mnt_root) { | 2025 | if (cur.dentry == cur.mnt->mnt_root) { |
2026 | if (follow_up(&cur)) | 2026 | if (follow_up(&cur)) |
@@ -3422,6 +3422,7 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, | |||
3422 | unsigned long maxcount; | 3422 | unsigned long maxcount; |
3423 | struct xdr_stream *xdr = &resp->xdr; | 3423 | struct xdr_stream *xdr = &resp->xdr; |
3424 | struct file *file = read->rd_filp; | 3424 | struct file *file = read->rd_filp; |
3425 | struct svc_fh *fhp = read->rd_fhp; | ||
3425 | int starting_len = xdr->buf->len; | 3426 | int starting_len = xdr->buf->len; |
3426 | struct raparms *ra; | 3427 | struct raparms *ra; |
3427 | __be32 *p; | 3428 | __be32 *p; |
@@ -3445,12 +3446,15 @@ nfsd4_encode_read(struct nfsd4_compoundres *resp, __be32 nfserr, | |||
3445 | maxcount = min_t(unsigned long, maxcount, (xdr->buf->buflen - xdr->buf->len)); | 3446 | maxcount = min_t(unsigned long, maxcount, (xdr->buf->buflen - xdr->buf->len)); |
3446 | maxcount = min_t(unsigned long, maxcount, read->rd_length); | 3447 | maxcount = min_t(unsigned long, maxcount, read->rd_length); |
3447 | 3448 | ||
3448 | if (!read->rd_filp) { | 3449 | if (read->rd_filp) |
3450 | err = nfsd_permission(resp->rqstp, fhp->fh_export, | ||
3451 | fhp->fh_dentry, | ||
3452 | NFSD_MAY_READ|NFSD_MAY_OWNER_OVERRIDE); | ||
3453 | else | ||
3449 | err = nfsd_get_tmp_read_open(resp->rqstp, read->rd_fhp, | 3454 | err = nfsd_get_tmp_read_open(resp->rqstp, read->rd_fhp, |
3450 | &file, &ra); | 3455 | &file, &ra); |
3451 | if (err) | 3456 | if (err) |
3452 | goto err_truncate; | 3457 | goto err_truncate; |
3453 | } | ||
3454 | 3458 | ||
3455 | if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) | 3459 | if (file->f_op->splice_read && test_bit(RQ_SPLICE_OK, &resp->rqstp->rq_flags)) |
3456 | err = nfsd4_encode_splice_read(resp, read, file, maxcount); | 3460 | err = nfsd4_encode_splice_read(resp, read, file, maxcount); |
diff --git a/fs/nfsd/nfsctl.c b/fs/nfsd/nfsctl.c index aa47d75ddb26..9690cb4dd588 100644 --- a/fs/nfsd/nfsctl.c +++ b/fs/nfsd/nfsctl.c | |||
@@ -1250,15 +1250,15 @@ static int __init init_nfsd(void) | |||
1250 | int retval; | 1250 | int retval; |
1251 | printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); | 1251 | printk(KERN_INFO "Installing knfsd (copyright (C) 1996 okir@monad.swb.de).\n"); |
1252 | 1252 | ||
1253 | retval = register_cld_notifier(); | ||
1254 | if (retval) | ||
1255 | return retval; | ||
1256 | retval = register_pernet_subsys(&nfsd_net_ops); | 1253 | retval = register_pernet_subsys(&nfsd_net_ops); |
1257 | if (retval < 0) | 1254 | if (retval < 0) |
1258 | goto out_unregister_notifier; | 1255 | return retval; |
1259 | retval = nfsd4_init_slabs(); | 1256 | retval = register_cld_notifier(); |
1260 | if (retval) | 1257 | if (retval) |
1261 | goto out_unregister_pernet; | 1258 | goto out_unregister_pernet; |
1259 | retval = nfsd4_init_slabs(); | ||
1260 | if (retval) | ||
1261 | goto out_unregister_notifier; | ||
1262 | retval = nfsd4_init_pnfs(); | 1262 | retval = nfsd4_init_pnfs(); |
1263 | if (retval) | 1263 | if (retval) |
1264 | goto out_free_slabs; | 1264 | goto out_free_slabs; |
@@ -1290,10 +1290,10 @@ out_exit_pnfs: | |||
1290 | nfsd4_exit_pnfs(); | 1290 | nfsd4_exit_pnfs(); |
1291 | out_free_slabs: | 1291 | out_free_slabs: |
1292 | nfsd4_free_slabs(); | 1292 | nfsd4_free_slabs(); |
1293 | out_unregister_pernet: | ||
1294 | unregister_pernet_subsys(&nfsd_net_ops); | ||
1295 | out_unregister_notifier: | 1293 | out_unregister_notifier: |
1296 | unregister_cld_notifier(); | 1294 | unregister_cld_notifier(); |
1295 | out_unregister_pernet: | ||
1296 | unregister_pernet_subsys(&nfsd_net_ops); | ||
1297 | return retval; | 1297 | return retval; |
1298 | } | 1298 | } |
1299 | 1299 | ||
@@ -1308,8 +1308,8 @@ static void __exit exit_nfsd(void) | |||
1308 | nfsd4_exit_pnfs(); | 1308 | nfsd4_exit_pnfs(); |
1309 | nfsd_fault_inject_cleanup(); | 1309 | nfsd_fault_inject_cleanup(); |
1310 | unregister_filesystem(&nfsd_fs_type); | 1310 | unregister_filesystem(&nfsd_fs_type); |
1311 | unregister_pernet_subsys(&nfsd_net_ops); | ||
1312 | unregister_cld_notifier(); | 1311 | unregister_cld_notifier(); |
1312 | unregister_pernet_subsys(&nfsd_net_ops); | ||
1313 | } | 1313 | } |
1314 | 1314 | ||
1315 | MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); | 1315 | MODULE_AUTHOR("Olaf Kirch <okir@monad.swb.de>"); |
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h index 565c4da1a9eb..cf980523898b 100644 --- a/fs/nfsd/nfsd.h +++ b/fs/nfsd/nfsd.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #include "export.h" | 24 | #include "export.h" |
25 | 25 | ||
26 | #undef ifdebug | 26 | #undef ifdebug |
27 | #ifdef NFSD_DEBUG | 27 | #ifdef CONFIG_SUNRPC_DEBUG |
28 | # define ifdebug(flag) if (nfsd_debug & NFSDDBG_##flag) | 28 | # define ifdebug(flag) if (nfsd_debug & NFSDDBG_##flag) |
29 | #else | 29 | #else |
30 | # define ifdebug(flag) if (0) | 30 | # define ifdebug(flag) if (0) |
diff --git a/fs/nfsd/xdr4.h b/fs/nfsd/xdr4.h index 0bda93e58e1b..556ce2e47555 100644 --- a/fs/nfsd/xdr4.h +++ b/fs/nfsd/xdr4.h | |||
@@ -40,7 +40,6 @@ | |||
40 | #include "state.h" | 40 | #include "state.h" |
41 | #include "nfsd.h" | 41 | #include "nfsd.h" |
42 | 42 | ||
43 | #define NFSD4_MAX_SEC_LABEL_LEN 2048 | ||
44 | #define NFSD4_MAX_TAGLEN 128 | 43 | #define NFSD4_MAX_TAGLEN 128 |
45 | #define XDR_LEN(n) (((n) + 3) & ~3) | 44 | #define XDR_LEN(n) (((n) + 3) & ~3) |
46 | 45 | ||
@@ -683,7 +682,7 @@ extern __be32 nfsd4_process_open2(struct svc_rqst *rqstp, | |||
683 | struct svc_fh *current_fh, struct nfsd4_open *open); | 682 | struct svc_fh *current_fh, struct nfsd4_open *open); |
684 | extern void nfsd4_cstate_clear_replay(struct nfsd4_compound_state *cstate); | 683 | extern void nfsd4_cstate_clear_replay(struct nfsd4_compound_state *cstate); |
685 | extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate, | 684 | extern void nfsd4_cleanup_open_state(struct nfsd4_compound_state *cstate, |
686 | struct nfsd4_open *open, __be32 status); | 685 | struct nfsd4_open *open); |
687 | extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, | 686 | extern __be32 nfsd4_open_confirm(struct svc_rqst *rqstp, |
688 | struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc); | 687 | struct nfsd4_compound_state *, struct nfsd4_open_confirm *oc); |
689 | extern __be32 nfsd4_close(struct svc_rqst *rqstp, | 688 | extern __be32 nfsd4_close(struct svc_rqst *rqstp, |