* [PATCH 4 of 9] MD: analyze_sbs failure if bad superblocks
@ 2011-05-24 3:06 Jonathan Brassow
0 siblings, 0 replies; only message in thread
From: Jonathan Brassow @ 2011-05-24 3:06 UTC (permalink / raw)
To: linux-raid
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) {
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-05-24 3:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-24 3:06 [PATCH 4 of 9] MD: analyze_sbs failure if bad superblocks Jonathan Brassow
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).