[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[dm-devel] [PATCH] 4/5: Use fixed-sized arrays



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

--- diff/drivers/md/dm-raid1.c	2004-06-21 14:13:17.000000000 -0500
+++ source/drivers/md/dm-raid1.c	2004-06-21 14:12:11.319890616 -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++) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]