diff options
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
-rw-r--r-- | fs/nfsd/nfs4acl.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/fs/nfsd/nfs4acl.c b/fs/nfsd/nfs4acl.c index b206e6cfcada..05c9b2f9427b 100644 --- a/fs/nfsd/nfs4acl.c +++ b/fs/nfsd/nfs4acl.c | |||
@@ -401,8 +401,10 @@ sort_pacl(struct posix_acl *pacl) | |||
401 | * by uid/gid. */ | 401 | * by uid/gid. */ |
402 | int i, j; | 402 | int i, j; |
403 | 403 | ||
404 | if (pacl->a_count <= 4) | 404 | /* no users or groups */ |
405 | return; /* no users or groups */ | 405 | if (!pacl || pacl->a_count <= 4) |
406 | return; | ||
407 | |||
406 | i = 1; | 408 | i = 1; |
407 | while (pacl->a_entries[i].e_tag == ACL_USER) | 409 | while (pacl->a_entries[i].e_tag == ACL_USER) |
408 | i++; | 410 | i++; |
@@ -529,13 +531,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags) | |||
529 | 531 | ||
530 | /* | 532 | /* |
531 | * ACLs with no ACEs are treated differently in the inheritable | 533 | * ACLs with no ACEs are treated differently in the inheritable |
532 | * and effective cases: when there are no inheritable ACEs, we | 534 | * and effective cases: when there are no inheritable ACEs, |
533 | * set a zero-length default posix acl: | 535 | * calls ->set_acl with a NULL ACL structure. |
534 | */ | 536 | */ |
535 | if (state->empty && (flags & NFS4_ACL_TYPE_DEFAULT)) { | 537 | if (state->empty && (flags & NFS4_ACL_TYPE_DEFAULT)) |
536 | pacl = posix_acl_alloc(0, GFP_KERNEL); | 538 | return NULL; |
537 | return pacl ? pacl : ERR_PTR(-ENOMEM); | 539 | |
538 | } | ||
539 | /* | 540 | /* |
540 | * When there are no effective ACEs, the following will end | 541 | * When there are no effective ACEs, the following will end |
541 | * up setting a 3-element effective posix ACL with all | 542 | * up setting a 3-element effective posix ACL with all |