linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jes Sorensen <Jes.Sorensen@redhat.com>
To: heinzm@redhat.com
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: raid5: add prerequisite to run underneath dm-raid
Date: Mon, 09 May 2016 16:47:02 -0400	[thread overview]
Message-ID: <wrfj8tzjrmbd.fsf@redhat.com> (raw)
In-Reply-To: <1462809009-2809-1-git-send-email-heinzm@redhat.com> (heinzm@redhat.com's message of "Mon, 9 May 2016 17:50:09 +0200")

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

  parent reply	other threads:[~2016-05-09 20:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-05-09 21:31   ` Heinz Mauelshagen

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=wrfj8tzjrmbd.fsf@redhat.com \
    --to=jes.sorensen@redhat.com \
    --cc=heinzm@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).