diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2016-05-03 22:15:31 +0200 |
---|---|---|
committer | Shaohua Li <shli@fb.com> | 2016-05-09 09:24:02 -0700 |
commit | fe67d19a2d7b31f1c29efbe1819c921d4a9bb012 (patch) | |
tree | bf491b1752b31fbce3f97fbf172dd600af667947 /drivers | |
parent | 859644f0fa2141b5f7db0e3744999ec3bb5719d3 (diff) | |
download | op-kernel-dev-fe67d19a2d7b31f1c29efbe1819c921d4a9bb012.zip op-kernel-dev-fe67d19a2d7b31f1c29efbe1819c921d4a9bb012.tar.gz |
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 <heinzm@redhat.com>
Signed-off-by: Shaohua Li <shli@fb.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index e48c262..4d31b23 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); |