From: Greg KH <gregkh@linuxfoundation.org>
To: shli@fb.com, sitsofe@gmail.com
Cc: stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] RAID10: ignore discard error" failed to apply to 4.4-stable tree
Date: Wed, 9 Nov 2016 10:01:55 +0100 [thread overview]
Message-ID: <20161109090155.GA6013@kroah.com> (raw)
In-Reply-To: <147868192456246@kroah.com>
On Wed, Nov 09, 2016 at 09:58:44AM +0100, gregkh@linuxfoundation.org wrote:
>
> The patch below does not apply to the 4.4-stable tree.
> If someone wants it applied there, or to any other stable or longterm
> tree, then please email the backport, including the original git commit
> id to <stable@vger.kernel.org>.
Well, it applied, but it broke the build, so I dropped it.
thanks,
greg k-h
> ------------------ original commit in Linus's tree ------------------
>
> >From 579ed34f7b751b8add233cba4cf755258dbdd60a Mon Sep 17 00:00:00 2001
> From: Shaohua Li <shli@fb.com>
> Date: Thu, 6 Oct 2016 14:13:52 -0700
> Subject: [PATCH] RAID10: ignore discard error
>
> This is the counterpart of raid10 fix. If a write error occurs, raid10
> will try to rewrite the bio in small chunk size. If the rewrite fails,
> raid10 will record the error in bad block. narrow_write_error will
> always use WRITE for the bio, but actually it could be a discard. Since
> discard bio hasn't payload, write the bio will cause different issues.
> But discard error isn't fatal, we can safely ignore it. This is what
> this patch does.
>
> This issue should exist since discard is added, but only exposed with
> recent arbitrary bio size feature.
>
> Cc: Sitsofe Wheeler <sitsofe@gmail.com>
> Cc: stable@vger.kernel.org (v3.6)
> Signed-off-by: Shaohua Li <shli@fb.com>
>
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index be1a9fca3b2d..39fddda2fef2 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -447,6 +447,9 @@ static void raid10_end_write_request(struct bio *bio)
> struct r10conf *conf = r10_bio->mddev->private;
> int slot, repl;
> struct md_rdev *rdev = NULL;
> + bool discard_error;
> +
> + discard_error = bio->bi_error && bio_op(bio) == REQ_OP_DISCARD;
>
> dev = find_bio_disk(conf, r10_bio, bio, &slot, &repl);
>
> @@ -460,7 +463,7 @@ static void raid10_end_write_request(struct bio *bio)
> /*
> * this branch is our 'one mirror IO has finished' event handler:
> */
> - if (bio->bi_error) {
> + if (bio->bi_error && !discard_error) {
> if (repl)
> /* Never record new bad blocks to replacement,
> * just fail it.
> @@ -503,7 +506,7 @@ static void raid10_end_write_request(struct bio *bio)
> if (is_badblock(rdev,
> r10_bio->devs[slot].addr,
> r10_bio->sectors,
> - &first_bad, &bad_sectors)) {
> + &first_bad, &bad_sectors) && !discard_error) {
> bio_put(bio);
> if (repl)
> r10_bio->devs[slot].repl_bio = IO_MADE_GOOD;
>
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
prev parent reply other threads:[~2016-11-09 9:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-09 8:58 FAILED: patch "[PATCH] RAID10: ignore discard error" failed to apply to 4.4-stable tree gregkh
2016-11-09 9:01 ` Greg KH [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=20161109090155.GA6013@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=shli@fb.com \
--cc=sitsofe@gmail.com \
--cc=stable@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 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.