Commit 98b2ac37 authored by Kevin Corry's avatar Kevin Corry Committed by Linus Torvalds

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

dm-raid1.c: Declare fixed-sized (instead of variable-sized) arrays on the
stack in recover() and do_write().
Signed-off-by: default avatarKevin Corry <kevcorry@us.ibm.com>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 1d2d4524
...@@ -602,7 +602,7 @@ static int recover(struct mirror_set *ms, struct region *reg) ...@@ -602,7 +602,7 @@ static int recover(struct mirror_set *ms, struct region *reg)
{ {
int r; int r;
unsigned int i; 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; struct mirror *m;
unsigned long flags = 0; unsigned long flags = 0;
...@@ -757,7 +757,7 @@ static void write_callback(unsigned long error, void *context) ...@@ -757,7 +757,7 @@ static void write_callback(unsigned long error, void *context)
static void do_write(struct mirror_set *ms, struct bio *bio) static void do_write(struct mirror_set *ms, struct bio *bio)
{ {
unsigned int i; unsigned int i;
struct io_region io[ms->nr_mirrors]; struct io_region io[KCOPYD_MAX_REGIONS+1];
struct mirror *m; struct mirror *m;
for (i = 0; i < ms->nr_mirrors; i++) { for (i = 0; i < ms->nr_mirrors; i++) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment