From: Heinz Mauelshagen Date: Tue, 3 May 2016 20:15:31 +0000 (+0200) Subject: md: raid5: add prerequisite to run underneath dm-raid X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=fe67d19a2d7b31f1c29efbe1819c921d4a9bb012;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git md: raid5: add prerequisite to run underneath dm-raid In case md runs underneath the dm-raid target, the mddev does not have a request queue or gendisk, thus avoid accesses. This patch adds a missing conditional to the raid5 personality. Signed-of-by: Heinz Mauelshagen Signed-off-by: Shaohua Li --- diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index e48c262ce032..4d31b235a888 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -7572,8 +7572,10 @@ static void raid5_finish_reshape(struct mddev *mddev) if (mddev->delta_disks > 0) { md_set_array_sectors(mddev, raid5_size(mddev, 0, 0)); - set_capacity(mddev->gendisk, mddev->array_sectors); - revalidate_disk(mddev->gendisk); + if (mddev->queue) { + set_capacity(mddev->gendisk, mddev->array_sectors); + revalidate_disk(mddev->gendisk); + } } else { int d; spin_lock_irq(&conf->device_lock);