aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-10-10 22:40:36 -0400
committerNeilBrown <neilb@suse.de>2012-10-10 22:40:36 -0400
commit7386199c471f70526bbcc629f072a5a8effe218f (patch)
treef9a9db7769a86450ccdda52fa64c2ee7f74b709e /drivers/md
parent4ec1e369af83f7ecdfbd48a905e44fc9910115ba (diff)
DM RAID: Fix comparison of index and quantity for "rebuild" parameter
DM RAID: Fix comparison of index and quantity for "rebuild" parameter The "rebuild" parameter takes an index argument that starts counting from zero. The conditional used to validate the index was using '>' rather than '>=', leaving the door open for an index value that would be 1 too large. Reported-by: Neil Brown <neilb@suse.de> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-raid.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index 4e79ebaab3c1..89a06a361332 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -539,7 +539,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
539 539
540 /* Parameters that take a numeric value are checked here */ 540 /* Parameters that take a numeric value are checked here */
541 if (!strcasecmp(key, "rebuild")) { 541 if (!strcasecmp(key, "rebuild")) {
542 if (value > rs->md.raid_disks) { 542 if (value >= rs->md.raid_disks) {
543 rs->ti->error = "Invalid rebuild index given"; 543 rs->ti->error = "Invalid rebuild index given";
544 return -EINVAL; 544 return -EINVAL;
545 } 545 }