All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinz Mauelshagen <heinzm@redhat.com>
To: Brassow Jonathan <jbrassow@redhat.com>,
	device-mapper development <dm-devel@redhat.com>
Subject: Re: [PATCH v2 2/4] md-raid0: conditional mddev->queue access to suit dm-raid
Date: Fri, 08 May 2015 18:52:37 +0200	[thread overview]
Message-ID: <554CE9D5.4080103@redhat.com> (raw)
In-Reply-To: <709E3551-BC68-46FE-9AEB-B2A834FC6199@redhat.com>



On 05/08/2015 06:00 PM, Brassow Jonathan wrote:
>> On Apr 29, 2015, at 7:03 AM, heinzm@redhat.com wrote:
>>
>> From: Heinz Mauelshagen <heinzm@redhat.com>
>>
>>
>> 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>
>>
>> ---
>> drivers/md/raid0.c | 5 +++--
>> 1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
>> index 2cb59a6..6a68ef5 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;
> Aren’t you missing a condition?
>
>  From the code:
>          /*
>           * now since we have the hard sector sizes, we can make sure
>           * chunk size is a multiple of that sector size
>           */
>          if ((mddev->chunk_sectors << 9) % queue_logical_block_size(mddev->queue)) {
>                  printk(KERN_ERR "md/raid0:%s: chunk_size of %d not valid\n",
>                         mdname(mddev),
>                         mddev->chunk_sectors << 9);
>                  goto abort;
>          }
>
>          if (mddev->queue) {
>
> Shouldn’t that ‘queue_logical_block_size be inside the lower ‘if’?

queue_logical_block_size is safe when mddev->queue == NULL,
so its no problem.

Heinz

>
>   brassow

-- 
===============================================================
Heinz Mauelshagen                               +49 2626 141200
Consulting Development Engineer             FAX +49 2626 924446
Red Hat GmbH
Am Sonnenhang 11
56242 Marienrachdorf
Germany                                       heinzm@redhat.com
===============================================================

--
dm-devel mailing list
dm-devel@redhat.com
https://www.redhat.com/mailman/listinfo/dm-devel

  reply	other threads:[~2015-05-08 16:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-29 12:03 [PATCH v2 2/4] md-raid0: conditional mddev->queue access to suit dm-raid heinzm
2015-05-08 16:00 ` Brassow Jonathan
2015-05-08 16:52   ` Heinz Mauelshagen [this message]
  -- strict thread matches above, loose matches on Subject: below --
2015-04-29 12:03 heinzm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=554CE9D5.4080103@redhat.com \
    --to=heinzm@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=jbrassow@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.