From: raz ben yehuda Date: Tue, 16 Jun 2009 07:01:36 +0000 (+1000) Subject: md: raid5: chunk size check in setup_conf X-Git-Tag: v2.6.31-rc1~143^2~20 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=740da44918680a0c72411ae4ccdd1861069afcc4;p=karo-tx-linux.git md: raid5: chunk size check in setup_conf have raid5 check chunk size in run/reshape method instead of in md Signed-off-by: raziebe@gmail.com Signed-off-by: NeilBrown --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 7fb97c65ad37..be4e62f611bc 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4336,7 +4336,8 @@ static raid5_conf_t *setup_conf(mddev_t *mddev) return ERR_PTR(-EINVAL); } - if (!mddev->new_chunk || mddev->new_chunk % PAGE_SIZE) { + if (!mddev->new_chunk || mddev->new_chunk % PAGE_SIZE || + !is_power_of_2(mddev->new_chunk)) { printk(KERN_ERR "raid5: invalid chunk size %d for %s\n", mddev->new_chunk, mdname(mddev)); return ERR_PTR(-EINVAL);