From: NeilBrown <neilb@suse.de>
To: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
Cc: linux-raid@vger.kernel.org, wojciech.neubauer@intel.com,
adam.kwolek@intel.com, dan.j.williams@intel.com,
ed.ciechanowski@intel.com
Subject: Re: [PATCH] FIX: Seg Fault in incremental if BBM log detected
Date: Thu, 17 Feb 2011 17:07:06 +1100 [thread overview]
Message-ID: <20110217170706.76f33d25@notabene.brown> (raw)
In-Reply-To: <20110216124204.9233.9404.stgit@gklab-128-111.igk.intel.com>
On Wed, 16 Feb 2011 13:42:04 +0100 Krzysztof Wojcik
<krzysztof.wojcik@intel.com> wrote:
> Bug detected for imsm metadata.
> Assembling of array using Incremental switch generate segmentation
> fault if BBM log is detected.
> Reason: missing return from Incremental_container if BBM is detected
> and unnecessary list=NULL assignment.
> This patch fix the problem and memory leak in this area.
>
> Signed-off-by: Krzysztof Wojcik <krzysztof.wojcik@intel.com>
> ---
> Incremental.c | 14 +++++++++++++-
> 1 files changed, 13 insertions(+), 1 deletions(-)
>
> diff --git a/Incremental.c b/Incremental.c
> index 889184f..26739fe 100644
> --- a/Incremental.c
> +++ b/Incremental.c
> @@ -1471,7 +1471,19 @@ static int Incremental_container(struct supertype *st, char *devname,
> if (list->array.state & (1<<MD_SB_BBM_ERRORS)) {
> fprintf(stderr, Name ": BBM log found in metadata. "
> "Cannot activate array(s).\n");
> - list = NULL;
> + /* free container data and exit */
> + while (list) {
> + struct mdinfo *d1 = list->next;
> + struct mdinfo *disk = list->devs;
> + while (disk) {
> + struct mdinfo *d2 = disk->next;
> + free(disk);
> + disk = d2;
> + }
> + free(list);
> + list = d1;
> + }
That can all be replaced with
sysfs_free(list);
> + return 2;
With that change, I have applied this patch, thanks.
NeilBrown
> }
>
> for (ra = list ; ra ; ra = ra->next) {
prev parent reply other threads:[~2011-02-17 6:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-16 12:42 [PATCH] FIX: Seg Fault in incremental if BBM log detected Krzysztof Wojcik
2011-02-17 6:07 ` NeilBrown [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=20110217170706.76f33d25@notabene.brown \
--to=neilb@suse.de \
--cc=adam.kwolek@intel.com \
--cc=dan.j.williams@intel.com \
--cc=ed.ciechanowski@intel.com \
--cc=krzysztof.wojcik@intel.com \
--cc=linux-raid@vger.kernel.org \
--cc=wojciech.neubauer@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).