diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2015-05-08 10:19:03 +0200 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2015-05-08 10:39:40 +0200 |
commit | b6538fe32966e63ef38897860ef220980d904974 (patch) | |
tree | eb4936369829f3e6f2233b621f2138f42d929ee3 /drivers/md/raid0.c | |
parent | Linux 4.1-rc2 (diff) | |
download | linux-b6538fe32966e63ef38897860ef220980d904974.tar.xz linux-b6538fe32966e63ef38897860ef220980d904974.zip |
md-raid0: conditional mddev->queue access to suit dm-raid
This patch is a prerequisite for dm-raid "raid0" support to allow
dm-raid to access the MD RAID0 personality doing unconditional
accesses to mddev->queue, which is NULL in case of dm-raid stacked on
top of MD.
Most of the conditional mddev->queue accesses made it to upstream but
this missing one, which prohibits md raid0 to set disk stack limits
(being done in dm core in case of md underneath dm).
Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>
Tested-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/raid0.c')
-rw-r--r-- | drivers/md/raid0.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c index 2cb59a641cd2..6a68ef5246d4 100644 --- a/drivers/md/raid0.c +++ b/drivers/md/raid0.c @@ -188,8 +188,9 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf) } dev[j] = rdev1; - disk_stack_limits(mddev->gendisk, rdev1->bdev, - rdev1->data_offset << 9); + if (mddev->queue) + disk_stack_limits(mddev->gendisk, rdev1->bdev, + rdev1->data_offset << 9); if (rdev1->bdev->bd_disk->queue->merge_bvec_fn) conf->has_merge_bvec = 1; |