Received: by 2002:a17:90b:8d0:0:0:0:0 with SMTP id ds16csp4875056pjb; Mon, 27 Jul 2020 07:21:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWCNdSkDwUKJlzPdRFrKSAypqA5vF1Xc4XkU/BPEiIHo+1htMvktxv9sfyw+WeYgnKeax+ X-Received: by 2002:a05:6402:cb3:: with SMTP id cn19mr22302715edb.368.1595859691513; Mon, 27 Jul 2020 07:21:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595859691; cv=none; d=google.com; s=arc-20160816; b=K4/jOBt9L8saG/Rgshcs6ky7ZcA0Q8TWrFBR39ZPUyfqzXKxrHx8x0ohzB3KmH0HiG Uurg+Q1hhzx10QfGk9Jif4Fneb88jIUSp8ZZra0Tk1TJSLA2Z0/mXKmE2RrfWkSvQZVU 8F2ZEZei+Er5uLKJTPqwu7E3Es2G8TdYJyazgz7TY+e4YOUWo7jzJFSosoujXhQZn8YP F/UJuQ6Deqv9innSWILjQAo7+OpDEBD4sh7pwiS8Pqv9UwjKSvW173W51ygWwSYB0ygb PU5Bahk6C6vBChRB4xX2DGXiw/+gIeFjkWdHS087tmdEdWfmTXGMpkn7NynUQn3vAOJl YtCA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=oo2rzWyCLsSLywV3bvE6v9JfOjGl6FMJMMCyJAYKBPQ=; b=lduIjjor4gKtJTdJZ/lzOjyu4N5yq2GHqIchx9bF18MWEDV05ohJmtoypFajqPD8Fo O5sEFGimQrfNC6esBr4nJ9vUMipiDhEkf+8pU4rGExaWxv4FnRXpXQvOhJ1nrtq0FSH6 Sk+Rv8/ncKUw8HljtfR6XZvQNbTd6Jf5b4EMc5hQjq0uVGCROFTpk6qavFfhMAxmCEfJ oOx28+2OG5f7yndZfFqU/CD9XoGqEyqbLvIoi6T5k1llqKYZ8gkrJZNJhtzpADxjBb49 zQOGdhi64D/gDE4raoQY0UXGJuK0RrumwWvRz8GFui7NOdUSXHBJGWQn4WOkW/UUnHxM ZsHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MZpvEY1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n2si5657251edt.572.2020.07.27.07.21.09; Mon, 27 Jul 2020 07:21:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=MZpvEY1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729886AbgG0OTp (ORCPT + 99 others); Mon, 27 Jul 2020 10:19:45 -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: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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