summary refs log tree commit diff
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)
downloadlinux-dd15073a269a5edcd87fd26d893286324a6cc856.tar.gz
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)
 	 * by uid/gid. */
 	int i, j;
 
-	if (pacl->a_count <= 4)
-		return; /* no users or groups */
+	/* no users or groups */
+	if (!pacl || pacl->a_count <= 4)
+		return;
+
 	i = 1;
 	while (pacl->a_entries[i].e_tag == ACL_USER)
 		i++;
@@ -529,13 +531,12 @@ posix_state_to_acl(struct posix_acl_state *state, unsigned int flags)
 
 	/*
 	 * ACLs with no ACEs are treated differently in the inheritable
-	 * and effective cases: when there are no inheritable ACEs, we
-	 * set a zero-length default posix acl:
+	 * and effective cases: when there are no inheritable ACEs,
+	 * calls ->set_acl with a NULL ACL structure.
 	 */
-	if (state->empty && (flags & NFS4_ACL_TYPE_DEFAULT)) {
-		pacl = posix_acl_alloc(0, GFP_KERNEL);
-		return pacl ? pacl : ERR_PTR(-ENOMEM);
-	}
+	if (state->empty && (flags & NFS4_ACL_TYPE_DEFAULT))
+		return NULL;
+
 	/*
 	 * When there are no effective ACEs, the following will end
 	 * up setting a 3-element effective posix ACL with all