linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Brassow <jbrassow@f14.redhat.com>
To: linux-raid@vger.kernel.org
Subject: [PATCH 4 of 9] MD:  analyze_sbs failure if bad superblocks
Date: Mon, 23 May 2011 22:06:31 -0500	[thread overview]
Message-ID: <201105240306.p4O36Vi4029440@f14.redhat.com> (raw)

Patch name: md-analyze_sbs-failure-if-bad-superblocks.patch

MD's superblock reader function should fail if all superblocks are bad.

analyze_sbs should return -EINVAL if the 'freshest'/best superblock cannot
be validated.  This is especially important to dm-raid.c, as it uses md_run
at creation time to validate array transitions.

Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>

Index: linux-2.6/drivers/md/md.c
===================================================================
--- linux-2.6.orig/drivers/md/md.c
+++ linux-2.6/drivers/md/md.c
@@ -2890,9 +2890,9 @@ static int analyze_sbs(mddev_t *mddev)
 			kick_rdev_from_array(rdev);
 		}
 
-
-	super_types[mddev->major_version].
-		validate_super(mddev, freshest);
+	/* If the freshest superblock available cannot be validated, fail. */
+	if (super_types[mddev->major_version].validate_super(mddev, freshest))
+		return -EINVAL;
 
 	i = 0;
 	rdev_for_each(rdev, tmp, mddev) {

                 reply	other threads:[~2011-05-24  3:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=201105240306.p4O36Vi4029440@f14.redhat.com \
    --to=jbrassow@f14.redhat.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 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).