Commit 03df2c59 authored by Matthias Kaehlcke's avatar Matthias Kaehlcke Committed by Greg Kroah-Hartman

md: raid10: remove VLAIS

commit 584ed9fa upstream.

The raid10 driver can't be built with clang since it uses a variable
length array in a structure (VLAIS):

drivers/md/raid10.c:4583:17: error: fields must have a constant size:
  'variable length array in structure' extension will never be supported

Allocate the r10bio struct with kmalloc instead of using the VLAIS

Shaohua: set the MD_RECOVERY_INTR bit
Neil Brown: use GFP_NOIO
Signed-off-by: default avatarMatthias Kaehlcke <>
Reviewed-by: default avatarGuenter Roeck <>
Signed-off-by: default avatarShaohua Li <>
Signed-off-by: default avatarNathan Chancellor <>
Signed-off-by: default avatarGreg Kroah-Hartman <>
parent 487467e7
......@@ -4591,15 +4591,18 @@ static int handle_reshape_read_error(struct mddev *mddev,
/* Use sync reads to get the blocks from somewhere else */
int sectors = r10_bio->sectors;
struct r10conf *conf = mddev->private;
struct {
struct r10bio r10_bio;
struct r10dev devs[conf->copies];
} on_stack;
struct r10bio *r10b = &on_stack.r10_bio;
struct r10bio *r10b;
int slot = 0;
int idx = 0;
struct page **pages;
r10b = kmalloc(sizeof(*r10b) +
sizeof(struct r10dev) * conf->copies, GFP_NOIO);
if (!r10b) {
set_bit(MD_RECOVERY_INTR, &mddev->recovery);
return -ENOMEM;
/* reshape IOs share pages from .devs[0].bio */
pages = get_resync_pages(r10_bio->devs[0].bio)->pages;
......@@ -4648,11 +4651,13 @@ static int handle_reshape_read_error(struct mddev *mddev,
/* couldn't read this block, must give up */
return -EIO;
sectors -= s;
return 0;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment