All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Pekka J Enberg <penberg@cs.helsinki.fi>,
	Vegard Nossum <vegard.nossum@gmail.com>,
	linux-kernel@vger.kernel.org, Eric Paris <eparis@redhat.com>,
	hugh.dickins@tiscali.co.uk
Subject: Re: shmem_fill_super(): WARNING: kmemcheck: Caught 32-bit read from uninitialized memory
Date: Sun, 20 Sep 2009 22:04:27 +0400	[thread overview]
Message-ID: <20090920180427.GA32176@lenovo> (raw)
In-Reply-To: <20090920175803.GB23736@elte.hu>

[Ingo Molnar - Sun, Sep 20, 2009 at 07:58:03PM +0200]
...
| 
| > [    0.408000] initcall init_mmap_min_addr+0x0/0x10 returned 0 after 0 usecs
| >
| > Reported-by: Ingo Molnar <mingo@elte.hu>
| > Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
| > ---
| >  mm/shmem.c |    5 +----
| >  1 files changed, 1 insertions(+), 4 deletions(-)
| >
| > diff --git a/mm/shmem.c b/mm/shmem.c
| > index d713239..a8f54f3 100644
| > --- a/mm/shmem.c
| > +++ b/mm/shmem.c
| > @@ -2307,17 +2307,14 @@ static int shmem_fill_super(struct super_block *sb,
| >  	int err = -ENOMEM;
| >
| >  	/* Round up to L1_CACHE_BYTES to resist false sharing */
| > -	sbinfo = kmalloc(max((int)sizeof(struct shmem_sb_info),
| > +	sbinfo = kzalloc(max((int)sizeof(struct shmem_sb_info),
| >  				L1_CACHE_BYTES), GFP_KERNEL);
| >  	if (!sbinfo)
| >  		return -ENOMEM;
| >
| > -	sbinfo->max_blocks = 0;
| > -	sbinfo->max_inodes = 0;
| >  	sbinfo->mode = S_IRWXUGO | S_ISVTX;
| >  	sbinfo->uid = current_fsuid();
| >  	sbinfo->gid = current_fsgid();
| > -	sbinfo->mpol = NULL;
| >  	sb->s_fs_info = sbinfo;
| 
| That looks like a step forward even without kmemcheck considered, right?
| 
| 	Ingo

Yeah, and we save a few cpu cycles as well :)

	-- Cyrill

  parent reply	other threads:[~2009-09-20 18:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-15  8:09 WARNING: kmemcheck: Caught 32-bit read from uninitialized memory (bf438284) Ingo Molnar
2009-09-15  8:59 ` Eric Dumazet
2009-09-15  9:34   ` Ingo Molnar
2009-09-15  9:39     ` David Miller
2009-09-20  7:22 ` shmem_fill_super(): WARNING: kmemcheck: Caught 32-bit read from uninitialized memory Ingo Molnar
2009-09-20 17:35   ` Vegard Nossum
2009-09-20 17:55     ` Pekka J Enberg
2009-09-20 17:58       ` Ingo Molnar
2009-09-20 18:01         ` Pekka Enberg
2009-09-20 18:40           ` Ingo Molnar
2009-09-20 18:04         ` Cyrill Gorcunov [this message]
2009-09-21 10:49       ` Hugh Dickins
2009-09-21 11:07         ` Pekka Enberg

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=20090920180427.GA32176@lenovo \
    --to=gorcunov@gmail.com \
    --cc=eparis@redhat.com \
    --cc=hugh.dickins@tiscali.co.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=penberg@cs.helsinki.fi \
    --cc=vegard.nossum@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.