]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/md/dm-raid.c
Merge branch 'akpm' (Andrew's patch-bomb)
[karo-tx-linux.git] / drivers / md / dm-raid.c
index 4e79ebaab3c1d11502c9fc94bfa9199e64dce827..45d94a7e7f6db798ce291546f7916b246203f85b 100644 (file)
@@ -539,7 +539,7 @@ static int parse_raid_params(struct raid_set *rs, char **argv,
 
                /* Parameters that take a numeric value are checked here */
                if (!strcasecmp(key, "rebuild")) {
-                       if (value > rs->md.raid_disks) {
+                       if (value >= rs->md.raid_disks) {
                                rs->ti->error = "Invalid rebuild index given";
                                return -EINVAL;
                        }
@@ -1017,6 +1017,19 @@ static int analyse_superblocks(struct dm_target *ti, struct raid_set *rs)
 
        freshest = NULL;
        rdev_for_each_safe(rdev, tmp, mddev) {
+               /*
+                * Skipping super_load due to DMPF_SYNC will cause
+                * the array to undergo initialization again as
+                * though it were new.  This is the intended effect
+                * of the "sync" directive.
+                *
+                * When reshaping capability is added, we must ensure
+                * that the "sync" directive is disallowed during the
+                * reshape.
+                */
+               if (rs->print_flags & DMPF_SYNC)
+                       continue;
+
                if (!rdev->meta_bdev)
                        continue;