linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bernd Schubert <bernd.schubert@itwm.fraunhofer.de>
To: Piergiorgio Sartor <piergiorgio.sartor@nexgo.de>,
	linux-raid@vger.kernel.org
Subject: Re: [PATCH] raid6check.c add page size check and repair
Date: Mon, 20 Jan 2014 17:11:41 +0100	[thread overview]
Message-ID: <52DD4ABD.5060605@itwm.fraunhofer.de> (raw)
In-Reply-To: <20140118181823.GA15757@lazy.lzy>

Hello Piergiorgio,

I'm going to review it in more detail later on this week and I think I 
also still have an outstanding patch. But on quick glance, I think your 
patch introduces a memory leak.

 > @@ -152,13 +165,14 @@
>   	char *stripe_buf = xmalloc(raid_disks * chunk_size);
>   	char **stripes = xmalloc(raid_disks * sizeof(char*));
>   	char **blocks = xmalloc(raid_disks * sizeof(char*));
> +	char **blocks_page = xmalloc(raid_disks * sizeof(char*));
>   	int *block_index_for_slot = xmalloc(raid_disks * sizeof(int));
>   	uint8_t *p = xmalloc(chunk_size);
>   	uint8_t *q = xmalloc(chunk_size);
>   	int *results = xmalloc(chunk_size * sizeof(int));
>   	sighandler_t *sig = xmalloc(3 * sizeof(sighandler_t));

I don't see free(blocks_page).

Btw, clangs static code checker is rather good to find such issues. 
Actually, it reports several issues with mdadm, I just didn't have the 
time to look into it in more detail.

Btw2: Any chance you could at least add the '-p' argument to your diff 
command? I think if you just would use git, it would do that automatically.


Thanks,
Bernd



  reply	other threads:[~2014-01-20 16:11 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-18 18:18 [PATCH] raid6check.c add page size check and repair Piergiorgio Sartor
2014-01-20 16:11 ` Bernd Schubert [this message]
2014-01-20 18:22   ` Piergiorgio Sartor
2014-01-20 19:10     ` Piergiorgio Sartor
2014-01-23  1:30       ` NeilBrown
2014-01-23 18:40         ` Piergiorgio Sartor
2014-01-20 19:21     ` Bernd Schubert

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=52DD4ABD.5060605@itwm.fraunhofer.de \
    --to=bernd.schubert@itwm.fraunhofer.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=piergiorgio.sartor@nexgo.de \
    /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;
as well as URLs for NNTP newsgroup(s).