All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] md: raid5: add prerequisite to run underneath dm-raid
@ 2016-05-09 15:50 heinzm
  2016-05-09 16:42 ` Shaohua Li
  2016-05-09 20:47 ` Jes Sorensen
  0 siblings, 2 replies; 5+ messages in thread
From: heinzm @ 2016-05-09 15:50 UTC (permalink / raw)
  To: linux-raid; +Cc: Heinz Mauelshagen

From: Heinz Mauelshagen <heinzm@redhat.com>

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>


---
 drivers/md/raid5.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 8ab8b65..ce79ce6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7574,8 +7574,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);
-- 
2.5.5


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] md: raid5: add prerequisite to run underneath dm-raid
  2016-05-09 15:50 [PATCH] md: raid5: add prerequisite to run underneath dm-raid heinzm
@ 2016-05-09 16:42 ` Shaohua Li
  2016-05-09 20:47 ` Jes Sorensen
  1 sibling, 0 replies; 5+ messages in thread
From: Shaohua Li @ 2016-05-09 16:42 UTC (permalink / raw)
  To: heinzm; +Cc: linux-raid

On Mon, May 09, 2016 at 05:50:09PM +0200, heinzm@redhat.com wrote:
> From: Heinz Mauelshagen <heinzm@redhat.com>
> 
> 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.

already added the 3 patches to my tree since you last post. I probably forgot
to reply you though, sorry.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] md: raid5: add prerequisite to run underneath dm-raid
  2016-05-09 15:50 [PATCH] md: raid5: add prerequisite to run underneath dm-raid heinzm
  2016-05-09 16:42 ` Shaohua Li
@ 2016-05-09 20:47 ` Jes Sorensen
  2016-05-09 21:31   ` Heinz Mauelshagen
  1 sibling, 1 reply; 5+ messages in thread
From: Jes Sorensen @ 2016-05-09 20:47 UTC (permalink / raw)
  To: heinzm; +Cc: linux-raid

heinzm@redhat.com writes:
> From: Heinz Mauelshagen <heinzm@redhat.com>
>
> 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>
>
>
> ---
>  drivers/md/raid5.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 8ab8b65..ce79ce6 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -7574,8 +7574,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);
> +			}

Since we're in the code taste mode, this is a reminder that kernel code
is 80 characters per line :)

Jes

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] md: raid5: add prerequisite to run underneath dm-raid
  2016-05-09 20:47 ` Jes Sorensen
@ 2016-05-09 21:31   ` Heinz Mauelshagen
  0 siblings, 0 replies; 5+ messages in thread
From: Heinz Mauelshagen @ 2016-05-09 21:31 UTC (permalink / raw)
  To: Jes Sorensen; +Cc: linux-raid



On 05/09/2016 10:47 PM, Jes Sorensen wrote:
> heinzm@redhat.com writes:
>> From: Heinz Mauelshagen <heinzm@redhat.com>
>>
>> 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>
>>
>>
>> ---
>>   drivers/md/raid5.c | 6 ++++--
>>   1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
>> index 8ab8b65..ce79ce6 100644
>> --- a/drivers/md/raid5.c
>> +++ b/drivers/md/raid5.c
>> @@ -7574,8 +7574,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);
>> +			}
> Since we're in the code taste mode, this is a reminder that kernel code
> is 80 characters per line :)

Hehe, gotta shorten > 20 lines in raid5.c alone then :-)

Heinz

>
> Jes


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] md: raid5: add prerequisite to run underneath dm-raid
@ 2016-05-09 15:50 heinzm
  0 siblings, 0 replies; 5+ messages in thread
From: heinzm @ 2016-05-09 15:50 UTC (permalink / raw)
  To: dm-devel; +Cc: Heinz Mauelshagen

From: Heinz Mauelshagen <heinzm@redhat.com>

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>


---
 drivers/md/raid5.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
index 8ab8b65..ce79ce6 100644
--- a/drivers/md/raid5.c
+++ b/drivers/md/raid5.c
@@ -7574,8 +7574,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);
-- 
2.5.5

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-05-09 21:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-09 15:50 [PATCH] md: raid5: add prerequisite to run underneath dm-raid heinzm
2016-05-09 16:42 ` Shaohua Li
2016-05-09 20:47 ` Jes Sorensen
2016-05-09 21:31   ` Heinz Mauelshagen
2016-05-09 15:50 heinzm

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.