Skip to content

Commit

Permalink
md: raid5: add prerequisite to run underneath dm-raid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Heinz Mauelshagen authored and Shaohua Li committed May 9, 2016
1 parent 859644f commit fe67d19
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit fe67d19

Please sign in to comment.