linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Jonathan Brassow <jbrassow@redhat.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] MD RAID10: Fix oops when creating RAID10 arrays via dm-raid.c
Date: Mon, 29 Oct 2012 09:40:46 +1100	[thread overview]
Message-ID: <20121029094046.04090cbe@notabene.brown> (raw)
In-Reply-To: <1351145870.20327.2.camel@f16>

[-- Attachment #1: Type: text/plain, Size: 2066 bytes --]

On Thu, 25 Oct 2012 01:17:50 -0500 Jonathan Brassow <jbrassow@redhat.com>
wrote:

> Commit 2863b9eb didn't take into account the changes to add TRIM support to
> RAID10 (commit 532a2a3fb).  That is, when using dm-raid.c to create the
> RAID10 arrays, there is no mddev->gendisk or mddev->queue.  The code added
> to support TRIM simply assumes that mddev->queue is available without
> checking.  The result is an oops any time dm-raid.c attempts to create a
> RAID10 device.
> 
> Signed-off-by: Jonathan Brassow <jbrassow@redhat.com>
> 
> Index: linux-upstream/drivers/md/raid10.c
> ===================================================================
> --- linux-upstream.orig/drivers/md/raid10.c
> +++ linux-upstream/drivers/md/raid10.c
> @@ -1783,7 +1783,7 @@ static int raid10_add_disk(struct mddev
>  		clear_bit(Unmerged, &rdev->flags);
>  	}
>  	md_integrity_add_rdev(rdev, mddev);
> -	if (blk_queue_discard(bdev_get_queue(rdev->bdev)))
> +	if (mddev->queue && blk_queue_discard(bdev_get_queue(rdev->bdev)))
>  		queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
>  
>  	print_conf(conf);
> @@ -3613,11 +3613,14 @@ static int run(struct mddev *mddev)
>  			discard_supported = true;
>  	}
>  
> -	if (discard_supported)
> -		queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
> -	else
> -		queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD, mddev->queue);
> -
> +	if (mddev->queue) {
> +		if (discard_supported)
> +			queue_flag_set_unlocked(QUEUE_FLAG_DISCARD,
> +						mddev->queue);
> +		else
> +			queue_flag_clear_unlocked(QUEUE_FLAG_DISCARD,
> +						  mddev->queue);
> +	}
>  	/* need to check that every block has at least one working mirror */
>  	if (!enough(conf, -1)) {
>  		printk(KERN_ERR "md/raid10:%s: not enough operational mirrors.\n",
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-raid" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Applied, thanks.

NeilBrown

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2012-10-28 22:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-25  6:17 [PATCH] MD RAID10: Fix oops when creating RAID10 arrays via dm-raid.c Jonathan Brassow
2012-10-28 22:40 ` NeilBrown [this message]

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=20121029094046.04090cbe@notabene.brown \
    --to=neilb@suse.de \
    --cc=jbrassow@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).