From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_PASS,URIBL_BLOCKED,USER_AGENT_MUTT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3C4FC43387 for ; Thu, 10 Jan 2019 19:26:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B333C208E3 for ; Thu, 10 Jan 2019 19:26:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547148365; bh=e4JcxktJgf3sy1BBD9KSXxaUYVzLzqUVZEiJWZNbw1Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=dnguvhHquUPsQdOFpZbqMVAAzngSuBEyHFnhFHlYXXaM7dpD1SPXTO4cH5UAELrlP 2xFbxm29BN53NYF47R1x56n8J+bbiHZK742cvLLMHEJObQretBLbzY72G2seY2cgtr zAegxIqTJVhbt6lkPpHvt8M7C1L36dia9lW7bHNQ= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728956AbfAJT0F (ORCPT ); Thu, 10 Jan 2019 14:26:05 -0500 Received: from mail.kernel.org ([198.145.29.99]:48424 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728572AbfAJT0F (ORCPT ); Thu, 10 Jan 2019 14:26:05 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2BB6920651; Thu, 10 Jan 2019 19:26:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1547148363; bh=e4JcxktJgf3sy1BBD9KSXxaUYVzLzqUVZEiJWZNbw1Y=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N0OJMDqIUM+7PzzxY8qkcLt9gQna27CWJODYokncHKCd8H3emxBUSls5FVWa95bRj zzV+v9gW4mm1tqfxxr/VYmMfXKvF0jyVb8fgGu5rr01tb1wxs3+U7ggHTvD88fHY4i HC7vqLMzvXHmmgBN2ACfzn+892lo8eUGoARoECgg= Date: Thu, 10 Jan 2019 20:26:01 +0100 From: "gregkh@linuxfoundation.org" To: Damien Le Moal Cc: "sashal@kernel.org" , "stable@vger.kernel.org" , "snitzer@redhat.com" Subject: Re: FAILED: patch "[PATCH] dm zoned: Fix target BIO completion handling" failed to apply to 4.19-stable tree Message-ID: <20190110192601.GJ18221@kroah.com> References: <1545145341108128@kroah.com> <20181218151939.GY2746@sasha-vm> <20181218153446.GA24528@kroah.com> <20181218154557.GA29411@kroah.com> <23baa5c2e830823c59fc4da066207ee0e58172c4.camel@wdc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <23baa5c2e830823c59fc4da066207ee0e58172c4.camel@wdc.com> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On Wed, Dec 19, 2018 at 03:43:34AM +0000, Damien Le Moal wrote: > On Tue, 2018-12-18 at 16:45 +0100, Greg KH wrote: > > On Tue, Dec 18, 2018 at 04:34:46PM +0100, Greg KH wrote: > > > On Tue, Dec 18, 2018 at 10:19:39AM -0500, Sasha Levin wrote: > > > > 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 . > > > > > > > > > > thanks, > > > > > > > > > > greg k-h > > > > > > > > > > ------------------ original commit in Linus's tree ----------- > > > > > ------- > > > > > > > > > > > From d57f9da890696af1484f4a47f7f123560197865a Mon Sep 17 > > > > > > 00:00:00 2001 > > > > > From: Damien Le Moal > > > > > 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 > > > > > Signed-off-by: Mike Snitzer > > > > > > > > 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. > > > > > > Ah, ok, let me see how tough the backport is... > > > > For 4.19, it was pretty easy. For 4.14.y, nah, it's too tough for me, > > I > > want someone who knows this code to do that work... > > > > thanks, > > > > greg k-h > > Greg, > > I just sent the backported patch to you and stable list. I re-tested as > well on top of 4.14.89 to make sure there were no mistakes. Thanks, that worked, now queued up. greg k-h