linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@cse.unsw.edu.au>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-raid@vger.kernel.org
Subject: [PATCH] md - 2 of 7 - Move the test in preferred_minor to where it is used.
Date: Fri, 23 Jan 2004 11:14:23 +1100	[thread overview]
Message-ID: <E1Ajoxr-0000jQ-00@notabene> (raw)
In-Reply-To: 20040123105615.2237.patches@notabene


A RAID superblock can indicate which minor number the array should be 
assembled under.  As this is only meaningful when doing auto-start,
we move the test for it being in the valid range to the place where
auto-start happens.  When an array is started any other way, it 
doesn't matter what value is here.

 ----------- Diffstat output ------------
 ./drivers/md/md.c |   11 ++++-------
 1 files changed, 4 insertions(+), 7 deletions(-)

diff ./drivers/md/md.c~current~ ./drivers/md/md.c
--- ./drivers/md/md.c~current~	2004-01-23 10:32:24.000000000 +1100
+++ ./drivers/md/md.c	2004-01-23 10:32:51.000000000 +1100
@@ -512,11 +512,6 @@ static int super_90_load(mdk_rdev_t *rde
 		goto abort;
 	}
 
-	if (sb->md_minor >= MAX_MD_DEVS) {
-		printk(KERN_ERR "md: %s: invalid raid minor (%x)\n",
-			b, sb->md_minor);
-		goto abort;
-	}
 	if (sb->raid_disks <= 0)
 		goto abort;
 
@@ -1829,7 +1824,7 @@ static void autorun_devices(void)
 				"md: md%d already running, cannot run %s\n",
 				mdidx(mddev), bdevname(rdev0->bdev,b));
 			mddev_unlock(mddev);
-		} else {
+		} else if (rdev0->preferred_minor >= 0 && rdev0->preferred_minor < MAX_MD_DEVS) {
 			printk(KERN_INFO "md: created md%d\n", mdidx(mddev));
 			ITERATE_RDEV_GENERIC(candidates,rdev,tmp) {
 				list_del_init(&rdev->same_set);
@@ -1838,7 +1833,9 @@ static void autorun_devices(void)
 			}
 			autorun_array(mddev);
 			mddev_unlock(mddev);
-		}
+		} else
+			printk(KERN_WARNING "md: %s had invalid preferred minor %d\n",
+			       bdevname(rdev->bdev, b), rdev0->preferred_minor);
 		/* on success, candidates will be empty, on error
 		 * it won't...
 		 */

  parent reply	other threads:[~2004-01-23  0:14 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-23  0:13 [PATCH] md - 0 of 7 - Introduction NeilBrown
2004-01-23  0:14 ` [PATCH] md - 1 of 7 - Fix possible hang in raid shutdown NeilBrown
2004-01-23  0:14 ` NeilBrown [this message]
2004-01-23  0:14 ` [PATCH] md - 4 of 7 - Collect device IO statistics for MD personalities NeilBrown
2004-01-23  0:14 ` [PATCH] md - 3 of 7 - Fixes to make debuging output nicer NeilBrown
2004-01-23  0:14 ` [PATCH] md - 5 of 7 - Change the way the name of an md device is printed in error messages NeilBrown
2004-01-23  0:14 ` [PATCH] md - 7 of 7 - Make sure md devices appear in /proc/partitions NeilBrown
2004-01-23  0:14 ` [PATCH] md - 6 of 7 - Allow partitioning of MD devices NeilBrown

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=E1Ajoxr-0000jQ-00@notabene \
    --to=neilb@cse.unsw.edu.au \
    --cc=akpm@osdl.org \
    --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).