aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfs4acl.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2014-05-08 14:58:42 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-05-08 14:59:06 -0400
commitdd15073a269a5edcd87fd26d893286324a6cc856 (patch)
treed130f5693025b697b4de015a60d2eb5691db4917 /fs/nfsd/nfs4acl.c
parent5409e46f1bcf960c651f3fff35f2f25e539655cf (diff)
parentaa07c713ecfc0522916f3cd57ac628ea6127c0ec (diff)
Merge 3.15 bugfix for 3.16
Diffstat (limited to 'fs/nfsd/nfs4acl.c')
-rw-r--r--fs/nfsd/nfs4acl.c17
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