Linux Device Mapper development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Heinz Mauelshagen <heinzm@redhat.com>
Cc: dm-devel@redhat.com
Subject: Re: dm raid1: "mirror" target doesn't use all available legs on multiple failures
Date: Mon, 10 Oct 2016 16:41:27 -0400	[thread overview]
Message-ID: <20161010204126.GA20089@redhat.com> (raw)
In-Reply-To: <1476118086-2975-1-git-send-email-heinzm@redhat.com>

On Mon, Oct 10 2016 at 12:48pm -0400,
Heinz Mauelshagen <heinzm@redhat.com> wrote:

> In case legs of a "mirror" target fail, any read will cause a new,
> operational default leg to be selected and the read be resubmitted
> to it. If that new default leg fails the read too, no other still
> accessible legs are used to resubmit the read again thus failing
> the io.
> 
> Fix by allowing the read to get resubmitted until there's no
> operational legs any more.
> 
> Resolves: rhbz1383444
> 
> Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com>

Nothing seems to be checking bio_record->details.bi_bdev anymore.
(The one you've removed really seems like a complete hack to begin with)

Shouldn't this patch go further by removing the other 2 places that set
bio_record->details.bi_bdev = NULL; ? 

> ---
>  drivers/md/dm-raid1.c | 11 -----------
>  1 file changed, 11 deletions(-)
> 
> diff --git a/drivers/md/dm-raid1.c b/drivers/md/dm-raid1.c
> index 7a6254d..dd31019 100644
> --- a/drivers/md/dm-raid1.c
> +++ b/drivers/md/dm-raid1.c
> @@ -1266,16 +1266,6 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
>  		goto out;
>  
>  	if (unlikely(error)) {
> -		if (!bio_record->details.bi_bdev) {
> -			/*
> -			 * There wasn't enough memory to record necessary
> -			 * information for a retry or there was no other
> -			 * mirror in-sync.
> -			 */
> -			DMERR_LIMIT("Mirror read failed.");
> -			return -EIO;
> -		}
> -
>  		m = bio_record->m;
>  
>  		DMERR("Mirror read failed from %s. Trying alternative device.",
> @@ -1291,7 +1281,6 @@ static int mirror_end_io(struct dm_target *ti, struct bio *bio, int error)
>  			bd = &bio_record->details;
>  
>  			dm_bio_restore(bd, bio);
> -			bio_record->details.bi_bdev = NULL;
>  			bio->bi_error = 0;
>  
>  			queue_bio(ms, bio, rw);
> -- 
> 2.7.4
> 

  reply	other threads:[~2016-10-10 20:41 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-10 16:48 [PATCH] dm raid1: "mirror" target doesn't use all available legs on multiple failures Heinz Mauelshagen
2016-10-10 20:41 ` Mike Snitzer [this message]
2016-10-11 14:56   ` 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=20161010204126.GA20089@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    --cc=heinzm@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox