[PATCH] 4/4: DM: dm-raid1.c: Use fixed-size arrays

From: Kevin Corry
Date: Wed Jun 30 2004 - 15:01:37 EST


dm-raid1.c: Declare fixed-sized (instead of variable-sized) arrays on the
stack in recover() and do_write().

Signed-off-by: Kevin Corry <kevcorry@xxxxxxxxxx>

--- diff/drivers/md/dm-raid1.c 2004-06-30 08:48:25.247347928 -0500
+++ source/drivers/md/dm-raid1.c 2004-06-30 08:48:30.101609968 -0500
@@ -602,7 +602,7 @@
{
int r;
unsigned int i;
- struct io_region from, to[ms->nr_mirrors - 1], *dest;
+ struct io_region from, to[KCOPYD_MAX_REGIONS], *dest;
struct mirror *m;
unsigned long flags = 0;

@@ -757,7 +757,7 @@
static void do_write(struct mirror_set *ms, struct bio *bio)
{
unsigned int i;
- struct io_region io[ms->nr_mirrors];
+ struct io_region io[KCOPYD_MAX_REGIONS+1];
struct mirror *m;

for (i = 0; i < ms->nr_mirrors; i++) {
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/