]> git.hungrycats.org Git - linux/commitdiff
[PATCH] dm: dm-raid1.c: Enforce max of 9 mirrors
authorKevin Corry <kevcorry@us.ibm.com>
Thu, 1 Jul 2004 03:52:27 +0000 (20:52 -0700)
committerLinus Torvalds <torvalds@ppc970.osdl.org>
Thu, 1 Jul 2004 03:52:27 +0000 (20:52 -0700)
dm-raid1.c: Since kcopyd can currently only handle 1 source and up to 8
destinations, enforce a max of 9 mirrors when creating a dm-mirror device.

Signed-off-by: Kevin Corry <kevcorry@us.ibm.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
drivers/md/dm-raid1.c

index 843e9b83d6d2af3bd24cb2bd0b2ee21c37f5b1b3..9d062b471b7f6c43560003f446b83ab5bcef7292 100644 (file)
@@ -1028,7 +1028,7 @@ static int mirror_ctr(struct dm_target *ti, unsigned int argc, char **argv)
        argc -= args_used;
 
        if (!argc || sscanf(argv[0], "%u", &nr_mirrors) != 1 ||
-           nr_mirrors < 2) {
+           nr_mirrors < 2 || nr_mirrors > KCOPYD_MAX_REGIONS + 1) {
                ti->error = "dm-mirror: Invalid number of mirrors";
                dm_destroy_dirty_log(dl);
                return -EINVAL;