The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Matt Keenan <tank.en.mate@gmail.com>
To: young dave <hidave.darkstar@gmail.com>
Cc: Jeff Garzik <jeff@garzik.org>,
	"J. Bruce Fields" <bfields@fieldses.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	neilb@suse.de, nfs@lists.sourceforge.net,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [NFS] [PATCH] NFSD: fix uninitialized variable
Date: Tue, 29 May 2007 08:29:14 +0100	[thread overview]
Message-ID: <465BD64A.3040302@gmail.com> (raw)
In-Reply-To: <a8e1da0705282131w72fbed65g8cb28589202298c1@mail.gmail.com>

young dave wrote:
> 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);
>
                                                                          
^^^^^

apart from the fact that this patch won't compile let alone run...


Matt


  reply	other threads:[~2007-05-29  7:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-27 10:34 [PATCH] NFSD: fix uninitialized variable Jeff Garzik
2007-05-29  3:00 ` [NFS] " J. Bruce Fields
2007-05-29  3:19   ` Jeff Garzik
2007-05-29  4:31     ` young dave
2007-05-29  7:29       ` Matt Keenan [this message]
2007-05-29  8:32         ` young dave
2007-05-29 19:52     ` J. Bruce Fields

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=465BD64A.3040302@gmail.com \
    --to=tank.en.mate@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=bfields@fieldses.org \
    --cc=hidave.darkstar@gmail.com \
    --cc=jeff@garzik.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=neilb@suse.de \
    --cc=nfs@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox