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 212A5C433ED for ; Mon, 27 Jul 2020 14:13:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3B5E2083E for ; Mon, 27 Jul 2020 14:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859200; bh=Gj23uE/wUAfv9Vn6JjfEiTHDxLgeQuJq4HzYtVmfryI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=FF8aDSpNSEvKOzq2nrO9RGh7kzRaUpi1jtis1SFtByKvvLrvqSZv6IDnV98wI0F+8 OeizTJFndaw9mgYAA+39/FTCXpxdtOQVoEaDHcVWqyW/dY+DsXGuqbN8nqCUyoQ85y +8HP/zNCJjtYHZ43GK8RA/kHqypRLXJvibpZH5TI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730347AbgG0ONS (ORCPT ); Mon, 27 Jul 2020 10:13:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:38190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729744AbgG0ONR (ORCPT ); Mon, 27 Jul 2020 10:13:17 -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 365DA2073E; Mon, 27 Jul 2020 14:13:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595859196; bh=Gj23uE/wUAfv9Vn6JjfEiTHDxLgeQuJq4HzYtVmfryI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=t0YNqfcr/FHOksFOET7bYxTU61Fp8+7NSqyDqP31NCIZ/2Lj+i/rrB0y+wap/Ind5 +gTizoM4uymUdY/kHhtGMN9QkBNjKzKtBa6F1bL/h3ZFYIZ4hTKQUc33noTe0yxmVG 19nFxMTfAXd2nHbhK18LtNVrDNFQbq0QVrRjgnsQ= 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.4 016/138] dm: use bio_uninit instead of bio_disassociate_blkg Date: Mon, 27 Jul 2020 16:03:31 +0200 Message-Id: <20200727134926.093362997@linuxfoundation.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200727134925.228313570@linuxfoundation.org> References: <20200727134925.228313570@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 915019ec0e25b..3cf5b354568e5 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1437,9 +1437,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; } @@ -1627,6 +1624,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 (bio_op(bio) == REQ_OP_ZONE_RESET) { ci.bio = bio; @@ -1701,6 +1699,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