From: "young dave" Subject: Re: [NFS] [PATCH] NFSD: fix uninitialized variable Date: Tue, 29 May 2007 04:31:12 +0000 Message-ID: References: <20070527103442.GA10594@havoc.gtf.org> <20070529030050.GB20631@fieldses.org> <465B9BB9.7060300@garzik.org> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Cc: "J. Bruce Fields" , "Andrew Morton" , neilb@suse.de, nfs@lists.sourceforge.net, LKML To: "Jeff Garzik" Return-path: In-Reply-To: <465B9BB9.7060300@garzik.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: Hi, > Given what you said above, I don't see gcc, on its best day, will ever > know enough to validate that that variable is indeed always initialized. > So I would vote for silencing it on those grounds. I agree too. How about this one: diff -dur linux/fs/nfsd/nfs4acl.c linux.new/fs/nfsd/nfs4acl.c --- linux/fs/nfsd/nfs4acl.c 2007-05-29 12:28:29.000000000 +0000 +++ linux.new/fs/nfsd/nfs4acl.c 2007-05-29 12:30:45.000000000 +0000 @@ -183,8 +183,6 @@ summarize_posix_acl(struct posix_acl *acl, struct posix_acl_summary *pas) { struct posix_acl_entry *pa, *pe; - pas->users = 0; - pas->groups = 0; pas->mask = 07; pe = acl->a_entries + acl->a_count; @@ -229,6 +227,7 @@ int eflag = ((flags & NFS4_ACL_TYPE_DEFAULT) ? NFS4_INHERITANCE_FLAGS | NFS4_ACE_INHERIT_ONLY_ACE : 0); + memset(pas, 0, sizeof(struct posix_acl_summary); BUG_ON(pacl->a_count < 3); summarize_posix_acl(pacl, &pas); Regards dave