NLM: Remove "proto" argument from lockd_up()
[safe/jmp/linux-2.6] / fs / nfsd / nfs4acl.c
index cc3b7ba..54b8b41 100644 (file)
@@ -183,8 +183,13 @@ static void
 summarize_posix_acl(struct posix_acl *acl, struct posix_acl_summary *pas)
 {
        struct posix_acl_entry *pa, *pe;
-       pas->users = 0;
-       pas->groups = 0;
+
+       /*
+        * Only pas.users and pas.groups need initialization; previous
+        * posix_acl_valid() calls ensure that the other fields will be
+        * initialized in the following loop.  But, just to placate gcc:
+        */
+       memset(pas, 0, sizeof(*pas));
        pas->mask = 07;
 
        pe = acl->a_entries + acl->a_count;
@@ -438,7 +443,7 @@ init_state(struct posix_acl_state *state, int cnt)
         * enough space for either:
         */
        alloc = sizeof(struct posix_ace_state_array)
-               + cnt*sizeof(struct posix_ace_state);
+               + cnt*sizeof(struct posix_user_ace_state);
        state->users = kzalloc(alloc, GFP_KERNEL);
        if (!state->users)
                return -ENOMEM;
@@ -732,13 +737,16 @@ int nfs4_acl_nfsv4_to_posix(struct nfs4_acl *acl, struct posix_acl **pacl,
        *pacl = posix_state_to_acl(&effective_acl_state, flags);
        if (IS_ERR(*pacl)) {
                ret = PTR_ERR(*pacl);
+               *pacl = NULL;
                goto out_dstate;
        }
        *dpacl = posix_state_to_acl(&default_acl_state,
                                                flags | NFS4_ACL_TYPE_DEFAULT);
        if (IS_ERR(*dpacl)) {
                ret = PTR_ERR(*dpacl);
+               *dpacl = NULL;
                posix_acl_release(*pacl);
+               *pacl = NULL;
                goto out_dstate;
        }
        sort_pacl(*pacl);