stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: gregkh@linuxfoundation.org
Cc: damien.lemoal@wdc.com, snitzer@redhat.com, stable@vger.kernel.org
Subject: Re: FAILED: patch "[PATCH] dm zoned: Fix target BIO completion handling" failed to apply to 4.19-stable tree
Date: Tue, 18 Dec 2018 10:19:39 -0500	[thread overview]
Message-ID: <20181218151939.GY2746@sasha-vm> (raw)
In-Reply-To: <1545145341108128@kroah.com>

On Tue, Dec 18, 2018 at 04:02:21PM +0100, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 4.19-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>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>>From d57f9da890696af1484f4a47f7f123560197865a Mon Sep 17 00:00:00 2001
>From: Damien Le Moal <damien.lemoal@wdc.com>
>Date: Fri, 30 Nov 2018 15:31:48 +0900
>Subject: [PATCH] dm zoned: Fix target BIO completion handling
>
>struct bioctx includes the ref refcount_t to track the number of I/O
>fragments used to process a target BIO as well as ensure that the zone
>of the BIO is kept in the active state throughout the lifetime of the
>BIO. However, since decrementing of this reference count is done in the
>target .end_io method, the function bio_endio() must be called multiple
>times for read and write target BIOs, which causes problems with the
>value of the __bi_remaining struct bio field for chained BIOs (e.g. the
>clone BIO passed by dm core is large and splits into fragments by the
>block layer), resulting in incorrect values and inconsistencies with the
>BIO_CHAIN flag setting. This is turn triggers the BUG_ON() call:
>
>BUG_ON(atomic_read(&bio->__bi_remaining) <= 0);
>
>in bio_remaining_done() called from bio_endio().
>
>Fix this ensuring that bio_endio() is called only once for any target
>BIO by always using internal clone BIOs for processing any read or
>write target BIO. This allows reference counting using the target BIO
>context counter to trigger the target BIO completion bio_endio() call
>once all data, metadata and other zone work triggered by the BIO
>complete.
>
>Overall, this simplifies the code too as the target .end_io becomes
>unnecessary and differences between read and write BIO issuing and
>completion processing disappear.
>
>Fixes: 3b1a94c88b79 ("dm zoned: drive-managed zoned block device target")
>Cc: stable@vger.kernel.org
>Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
>Signed-off-by: Mike Snitzer <snitzer@redhat.com>

This patch depends on 092b5648760a ("dm zoned: target: use refcount_t
for dm zoned reference counters"), it might make sense to just take it
as is instead of backporting d57f9da89069.

--
Thanks,
Sasha

  reply	other threads:[~2018-12-18 15:19 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-18 15:02 FAILED: patch "[PATCH] dm zoned: Fix target BIO completion handling" failed to apply to 4.19-stable tree gregkh
2018-12-18 15:19 ` Sasha Levin [this message]
2018-12-18 15:34   ` Greg KH
2018-12-18 15:45     ` Greg KH
2018-12-19  3:43       ` Damien Le Moal
2019-01-10 19:26         ` gregkh

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=20181218151939.GY2746@sasha-vm \
    --to=sashal@kernel.org \
    --cc=damien.lemoal@wdc.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=snitzer@redhat.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 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).