linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Guoqing Jiang <gqjiang@suse.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: [PATCH] md: simplify code with bio_io_error
Date: Fri, 2 Jun 2017 09:29:26 -0700	[thread overview]
Message-ID: <20170602162926.onnaflcf26ahuoti@kernel.org> (raw)
In-Reply-To: <20170602074914.26842-1-gqjiang@suse.com>

On Fri, Jun 02, 2017 at 03:49:14PM +0800, Guoqing Jiang wrote:
> bio_io_error was introduced in the commit 4246a0b
> ("block: add a bi_error field to struct bio"), so
> use it to simplify code.
> 
> Signed-off-by: Guoqing Jiang <gqjiang@suse.com>

Applied, thanks! There are several other places which could use conversion, I added
too.

> ---
>  drivers/md/raid1.c  | 3 +--
>  drivers/md/raid10.c | 3 +--
>  drivers/md/raid5.c  | 3 +--
>  3 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
> index af5056d..c20eb78 100644
> --- a/drivers/md/raid1.c
> +++ b/drivers/md/raid1.c
> @@ -802,8 +802,7 @@ static void flush_bio_list(struct r1conf *conf, struct bio *bio)
>  		bio->bi_next = NULL;
>  		bio->bi_bdev = rdev->bdev;
>  		if (test_bit(Faulty, &rdev->flags)) {
> -			bio->bi_error = -EIO;
> -			bio_endio(bio);
> +			bio_io_error(bio);
>  		} else if (unlikely((bio_op(bio) == REQ_OP_DISCARD) &&
>  				    !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
>  			/* Just ignore it */
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 4343d7f..ceb9709 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -913,8 +913,7 @@ static void flush_pending_writes(struct r10conf *conf)
>  			bio->bi_next = NULL;
>  			bio->bi_bdev = rdev->bdev;
>  			if (test_bit(Faulty, &rdev->flags)) {
> -				bio->bi_error = -EIO;
> -				bio_endio(bio);
> +				bio_io_error(bio);
>  			} else if (unlikely((bio_op(bio) ==  REQ_OP_DISCARD) &&
>  					    !blk_queue_discard(bdev_get_queue(bio->bi_bdev))))
>  				/* Just ignore it */
> diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
> index 7220646..57aa044 100644
> --- a/drivers/md/raid5.c
> +++ b/drivers/md/raid5.c
> @@ -3429,8 +3429,7 @@ handle_failed_stripe(struct r5conf *conf, struct stripe_head *sh,
>  				struct bio *nextbi =
>  					r5_next_bio(bi, sh->dev[i].sector);
>  
> -				bi->bi_error = -EIO;
> -				bio_endio(bi);
> +				bio_io_error(bi);
>  				bi = nextbi;
>  			}
>  		}
> -- 
> 2.10.0
> 
> --
> 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

  reply	other threads:[~2017-06-02 16:29 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-02  7:49 [PATCH] md: simplify code with bio_io_error Guoqing Jiang
2017-06-02 16:29 ` Shaohua Li [this message]
2017-06-03  5:57   ` Christoph Hellwig
2017-06-05  3:11     ` Guoqing Jiang

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=20170602162926.onnaflcf26ahuoti@kernel.org \
    --to=shli@kernel.org \
    --cc=gqjiang@suse.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).