linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: "Hawrylewicz Czarnowski,
	Przemyslaw" <przemyslaw.hawrylewicz.czarnowski@intel.com>
Cc: Doug Ledford <dledford@redhat.com>,
	"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>,
	"Williams, Dan J" <dan.j.williams@intel.com>,
	"Ciechanowski, Ed" <ed.ciechanowski@intel.com>
Subject: Re: [PATCH 1/2] imsm: delete subarray functionality
Date: Fri, 2 Apr 2010 16:36:14 +1100	[thread overview]
Message-ID: <20100402163614.11ff0fc9@notabene.brown> (raw)
In-Reply-To: <66C59AD0932712458090B447266D638CD3CE3017@irsmsx504.ger.corp.intel.com>

On Thu, 1 Apr 2010 22:31:40 +0100
"Hawrylewicz Czarnowski, Przemyslaw"
<przemyslaw.hawrylewicz.czarnowski@intel.com> wrote:

> >-----Original Message-----
> >From: Doug Ledford [mailto:dledford@redhat.com]
> >Sent: Thursday, April 01, 2010 6:32 PM
> >To: Hawrylewicz Czarnowski, Przemyslaw; Neil Brown; linux-
> >raid@vger.kernel.org; Williams, Dan J; Ciechanowski, Ed
> >Subject: Re: [PATCH 1/2] imsm: delete subarray functionality
> >
> >On 04/01/2010 02:09 AM, Luca Berra wrote:
> >> On Wed, Mar 31, 2010 at 09:50:40PM +0100, Hawrylewicz Czarnowski,
> >> Przemyslaw wrote:
> >
> >>> int mdmon_pid(int devnum)
> >>> @@ -1502,7 +1523,11 @@ int mdmon_pid(int devnum)
> >>>        char pid[10];
> >>>        int fd;
> >>>        int n;
> >>> -       sprintf(path, "%s/%s.pid", pid_dir, devnum2devname(devnum));
> >>> +       char *devname = devnum2devname(devnum);
> >>> +
> >>> +       sprintf(path, "%s/%s.pid", pid_dir, devname);
> >>> +       free(devname);
> >>> +
> >>>        fd = open(path, O_RDONLY | O_NOATIME, 0);
> >>>
> >>>        if (fd < 0)
> >> why?
> >
> >Looks like it leaks memory in the old implementation.
> For both mdmon_running and mdmon_pid there is a memory leak with strdup.
> Did I miss something?

Well you missed that when you fix a memory leak, you should create a patch
which just fixes memory leaks, you should put a comment on the top of the
patch saying that it fixes memory leaks, and you should post it.  Not bury
the memory-leak fix in amongst lots of other changes.  Doing it that way
would make review a lot faster.

NeilBrown

> 
> >
> >--
> >Doug Ledford <dledford@redhat.com>
> >              GPG KeyID: CFBFF194
> >	      http://people.redhat.com/dledford
> >
> >Infiniband specific RPMs available at
> >	      http://people.redhat.com/dledford/Infiniband
> 
> 
> --
> Best Regards,
> Przemyslaw Hawrylewicz-Czarnowski
> Software Development Engineer


  reply	other threads:[~2010-04-02  5:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-31 20:50 [PATCH 1/2] imsm: delete subarray functionality Hawrylewicz Czarnowski, Przemyslaw
2010-04-01  6:09 ` Luca Berra
2010-04-01 16:31   ` Doug Ledford
2010-04-01 21:31     ` Hawrylewicz Czarnowski, Przemyslaw
2010-04-02  5:36       ` Neil Brown [this message]
2010-04-01 21:29   ` Hawrylewicz Czarnowski, Przemyslaw
2010-04-01 16:41 ` Doug Ledford

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=20100402163614.11ff0fc9@notabene.brown \
    --to=neilb@suse.de \
    --cc=dan.j.williams@intel.com \
    --cc=dledford@redhat.com \
    --cc=ed.ciechanowski@intel.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=przemyslaw.hawrylewicz.czarnowski@intel.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;
as well as URLs for NNTP newsgroup(s).