All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chris Webb <chris@arachsys.com>
To: linux-raid@vger.kernel.org
Subject: [PATCH] Segfault with --assemble --force
Date: Wed, 18 Jun 2008 20:35:54 +0100	[thread overview]
Message-ID: <20080618193554.GA30682@arachsys.com> (raw)

mdadm --assemble --force repeatedly segfaults when run on a raid6 array with
more than two components marked as failed, so at least one needs its event
count forcibly updated. sb->events is accessed with sb NULL in update_super1,
called from Assemble (line 667 of Assemble.c). I think the following patch is
correct:

diff -uNrp mdadm-2.6.7.orig/Assemble.c mdadm-2.6.7/Assemble.c
--- mdadm-2.6.7.orig/Assemble.c	2008-06-18 20:23:36.000000000 +0100
+++ mdadm-2.6.7/Assemble.c	2008-06-18 20:23:47.000000000 +0100
@@ -656,7 +656,7 @@ int Assemble(struct supertype *st, char 
 			continue;
 		}
 		tst = dup_super(st);
-		if (tst->ss->load_super(st,fd, NULL)) {
+		if (tst->ss->load_super(tst, fd, NULL)) {
 			close(fd);
 			fprintf(stderr, Name ": RAID superblock disappeared from %s - not updating.\n",
 				devices[chosen_drive].devname);

Cheers,

Chris.

             reply	other threads:[~2008-06-18 19:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-18 19:35 Chris Webb [this message]
2008-06-19  3:52 ` [PATCH] Segfault with --assemble --force Neil Brown

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=20080618193554.GA30682@arachsys.com \
    --to=chris@arachsys.com \
    --cc=linux-raid@vger.kernel.org \
    /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.