mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Roel Kluin <roel.kluin@gmail.com>
Cc: jens.axboe@oracle.com, LKML <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH] bio: sizeof pointer instead of size of the pointed-to type?
Date: Wed, 15 Jul 2009 13:49:05 -0400	[thread overview]
Message-ID: <x49r5whu99q.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <4A5DE10E.7010005@gmail.com> (Roel Kluin's message of "Wed, 15 Jul 2009 16:00:46 +0200")

Roel Kluin <roel.kluin@gmail.com> writes:

> Do not take the size of a pointer to determine the size of the pointed-to type
>
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
> ---
> This is not yet tested. Is it correct?
>
> diff --git a/fs/bio.c b/fs/bio.c
> index 7673800..e65c35d 100644
> --- a/fs/bio.c
> +++ b/fs/bio.c
> @@ -96,7 +96,7 @@ static struct kmem_cache *bio_find_or_create_slab(unsigned int extra_size)
>  	if (bio_slab_nr == bio_slab_max && entry == -1) {
>  		bio_slab_max <<= 1;
>  		bio_slabs = krealloc(bio_slabs,
> -				     bio_slab_max * sizeof(struct bio_slab),
> +				     bio_slab_max * sizeof(struct bio_slab *),
>  				     GFP_KERNEL);
>  		if (!bio_slabs)
>  			goto out_unlock;

NAK.  The code is correct as-is.

Cheers,
Jeff

      parent reply	other threads:[~2009-07-15 17:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-15 14:00 Roel Kluin
2009-07-15 14:18 ` Cyrill Gorcunov
2009-07-15 17:49 ` Jeff Moyer [this message]

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=x49r5whu99q.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=roel.kluin@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®