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=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable 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 2DC47C433F1 for ; Mon, 27 Jul 2020 14:19:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F01C32177B for ; Mon, 27 Jul 2020 14:19:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859586; bh=TRh+4gzYuKIy2BqkB2gH3yL1Ae8c0trDVyJ/lwGZ8aM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=jmxSI/ghTlAB6T6gI4SEhQWT6gFS485l/7XTlunkebeadm7ASPhN9JXKXEMENNwPb AjrfXEBfEUygdd/bvxAU4nZOB72GmUoJqhoAez3Th077erxBorL/btx6ykn9NNN8A9 of92eBEwH6qMcGBthb7URFZSrx2InhKSjyyuLvk4= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730854AbgG0OTo (ORCPT ); Mon, 27 Jul 2020 10:19:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:47662 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731406AbgG0OTh (ORCPT ); Mon, 27 Jul 2020 10:19:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.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 216F320825; Mon, 27 Jul 2020 14:19:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859576; bh=TRh+4gzYuKIy2BqkB2gH3yL1Ae8c0trDVyJ/lwGZ8aM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MZpvEY1l3SL2nFx626BL9ZTpgv/PjCwtmWWpYD4/qQXwmbdo6BHyGjdyqBMBjqLz/ 9DgaG/bTov0zI02f12yK4bcxGxeaWtNURW5fVTfPjXsaspYMc7jtCwRUzEcPhtSKrJ Ks81UwekFIL5/a3O/FTlTlcHmwa8fhgib0GKT/ro= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Christoph Hellwig , Johannes Thumshirn , Mike Snitzer , Sasha Levin Subject: [PATCH 5.7 017/179] dm: use bio_uninit instead of bio_disassociate_blkg Date: Mon, 27 Jul 2020 16:03:12 +0200 Message-Id: <20200727134933.511961229@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134932.659499757@linuxfoundation.org> References: <20200727134932.659499757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Christoph Hellwig [ Upstream commit 382761dc6312965a11f82f2217e16ec421bf17ae ] bio_uninit is the proper API to clean up a BIO that has been allocated on stack or inside a structure that doesn't come from the BIO allocator. Switch dm to use that instead of bio_disassociate_blkg, which really is an implementation detail. Note that the bio_uninit calls are also moved to the two callers of __send_empty_flush, so that they better pair with the bio_init calls used to initialize them. Signed-off-by: Christoph Hellwig Reviewed-by: Johannes Thumshirn Signed-off-by: Mike Snitzer Signed-off-by: Sasha Levin --- drivers/md/dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm.c b/drivers/md/dm.c index 05333fc2f8d2b..9793b04e9ff3b 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1446,9 +1446,6 @@ static int __send_empty_flush(struct clone_info *ci) BUG_ON(bio_has_data(ci->bio)); while ((ti = dm_table_get_target(ci->map, target_nr++))) __send_duplicate_bios(ci, ti, ti->num_flush_bios, NULL); - - bio_disassociate_blkg(ci->bio); - return 0; } @@ -1636,6 +1633,7 @@ static blk_qc_t __split_and_process_bio(struct mapped_device *md, ci.bio = &flush_bio; ci.sector_count = 0; error = __send_empty_flush(&ci); + bio_uninit(ci.bio); /* dec_pending submits any data associated with flush */ } else if (op_is_zone_mgmt(bio_op(bio))) { ci.bio = bio; @@ -1710,6 +1708,7 @@ static blk_qc_t __process_bio(struct mapped_device *md, struct dm_table *map, ci.bio = &flush_bio; ci.sector_count = 0; error = __send_empty_flush(&ci); + bio_uninit(ci.bio); /* dec_pending submits any data associated with flush */ } else { struct dm_target_io *tio; -- 2.25.1