Message ID | 20230106083317.93938-8-p.raghav@samsung.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp714263wrt; Fri, 6 Jan 2023 00:38:47 -0800 (PST) X-Google-Smtp-Source: AMrXdXujPbB+DgT93qrW7RFDmqoE3DbJcq890olqh6987dhC58oR9x5p8RGu3RihtiuqkFD3A3m8 X-Received: by 2002:a05:6402:380b:b0:480:f01b:a385 with SMTP id es11-20020a056402380b00b00480f01ba385mr48226168edb.4.1672994327641; Fri, 06 Jan 2023 00:38:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672994327; cv=none; d=google.com; s=arc-20160816; b=AIQNNqWa98wBNaRbKZ1gD67xt8Xb+M5oK4+MS1bZC4xfNo6jGr5ZgCn2ayee/RLA8s cEPFYicXUEJYyuDuNX+ParsFviW+BoJvWyZypvbkSdKwU4Z8UHMElVmfwGgUNtWeqFNG 2zwqSDlq+A3HA0U0F3hg9tYnp8S0AXW5CVODp3my1quIr5WgIY9aYaDl+IxfzuEsjzys Pifu6eETheftFNoOUAt81KhWMwZwqvL48zmlwCscfsEXBnBJpZ537yrceVGAcoiFYKks R5iOT4WtzsSjLdKCbBGgII9Q22BcKSHZ2Wvs+ryLxM0Zsca1BNKBWepmlPlyVw4H2XPe lFbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=ki5YCi75NytYdqt7jBnGHXj1OOScNdOplcKKRH7vS3o=; b=ZguORDa6v82ruLx/fc5DRkuSx1FMuIA4AEPqsKFm/TPA0ZeYtf7YyLknaOWzk38s1f Kc9gnNwQrNT2x0Xsuhm/hG4S2wX7RZ14R/ADjwMS936HrkBvL3sn8eNK7jykyKqo8vcK R/C/Orp0fHpPAaG0Y/gLbGKz7Ul5xVHU9QX5Rs1W5xeBPu6Xcioi1MBslMbk23V2Yb2i JcrJGW+ik9nZ2M2k16KzTwxLk0+faHBOIQh7xsyOBZL2QjTjYCsRAipklqBx7luU/FrR p5p1JbaqFF3fQOiwLjbRBUtXK5F3dtjOZzfeF/DexpZCQShAblHQ/txs4+lDZJBGsSZ7 b7xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YtzsNb3p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f5-20020aa7d845000000b004922b9ba177si827065eds.112.2023.01.06.00.38.23; Fri, 06 Jan 2023 00:38:47 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=YtzsNb3p; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232456AbjAFIe1 (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Fri, 6 Jan 2023 03:34:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48996 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232443AbjAFId2 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 6 Jan 2023 03:33:28 -0500 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5FB0B80ACD for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 00:33:27 -0800 (PST) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20230106083325euoutp0113ae92e574a6f226dc10d3be3abca767~3qy8kvvbc2179921799euoutp01q for <linux-kernel@vger.kernel.org>; Fri, 6 Jan 2023 08:33:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20230106083325euoutp0113ae92e574a6f226dc10d3be3abca767~3qy8kvvbc2179921799euoutp01q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1672994005; bh=ki5YCi75NytYdqt7jBnGHXj1OOScNdOplcKKRH7vS3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YtzsNb3p5ukwBbg3Z1DF6RY7c2g7hjRifZy337iRD0UoyWinTYTFvqz05If70KWdW J3a+eKZR3qk6/uvzGxmgvAbd1sgCi9h4q8U1q2BRVNeXc95m2XSKLjvre1KdTwkeYg yThgZYnKFjSmYkEqNBGOXv/UQeHt+mIs9k4NxI1c= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20230106083324eucas1p2a41a4dc8a4943a42cebd2faff7b4f11b~3qy7O-sUd0368903689eucas1p23; Fri, 6 Jan 2023 08:33:24 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 5A.14.61936.3DCD7B36; Fri, 6 Jan 2023 08:33:23 +0000 (GMT) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20230106083323eucas1p2f0f6d5d5c1c3713be35b841157ae463e~3qy6rXvLi0142401424eucas1p2Q; Fri, 6 Jan 2023 08:33:23 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20230106083323eusmtrp21b31fb042b763934d753f5d411f81c64~3qy6qwBSI1128211282eusmtrp2F; Fri, 6 Jan 2023 08:33:23 +0000 (GMT) X-AuditID: cbfec7f4-a2dff7000002f1f0-de-63b7dcd3c38d Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FE.AB.52424.3DCD7B36; Fri, 6 Jan 2023 08:33:23 +0000 (GMT) Received: from localhost (unknown [106.210.248.66]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20230106083323eusmtip2fe614ae8c9a0dcec5c403fa52c600eb8~3qy6fASkM2941329413eusmtip2G; Fri, 6 Jan 2023 08:33:23 +0000 (GMT) From: Pankaj Raghav <p.raghav@samsung.com> To: axboe@kernel.dk Cc: kernel@pankajraghav.com, linux-kernel@vger.kernel.org, hare@suse.de, bvanassche@acm.org, snitzer@kernel.org, dm-devel@redhat.com, damien.lemoal@opensource.wdc.com, linux-nvme@lists.infradead.org, hch@lst.de, linux-block@vger.kernel.org, gost.dev@samsung.com, Pankaj Raghav <p.raghav@samsung.com> Subject: [PATCH 7/7] dm: call dm_zone_endio after the target endio callback for zoned devices Date: Fri, 6 Jan 2023 09:33:17 +0100 Message-Id: <20230106083317.93938-8-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230106083317.93938-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrEKsWRmVeSWpSXmKPExsWy7djPc7qX72xPNvi01dpi9d1+NotpH34y W/w+e57ZYu+72awWNw/sZLLYs2gSk8XK1UeZLM68/MxisfeWtsXlXXPYLOYve8pu8XlpC7vF iVvSDrwel694e1w+W+qxaVUnm8fmJfUeu282sHnsbL3P6nF2paPH+31X2Tz6tqxi9Nh8utrj 8ya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Type: text/plain; charset="utf-8" X-RootMTR: 20230106083323eucas1p2f0f6d5d5c1c3713be35b841157ae463e X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20230106083323eucas1p2f0f6d5d5c1c3713be35b841157ae463e References: <20230106083317.93938-1-p.raghav@samsung.com> <CGME20230106083323eucas1p2f0f6d5d5c1c3713be35b841157ae463e@eucas1p2.samsung.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754261700251204619?= X-GMAIL-MSGID: =?utf-8?q?1754261700251204619?= |
Series |
block zoned cleanups
|
|
Commit Message
Pankaj Raghav
Jan. 6, 2023, 8:33 a.m. UTC
dm_zone_endio() updates the bi_sector of orig bio for zoned devices that uses either native append or append emulation, and it is called before the endio of the target. But target endio can still update the clone bio after dm_zone_endio is called, thereby, the orig bio does not contain the updated information anymore. Currently, this is not a problem as the targets that support zoned devices such as dm-zoned, dm-linear, and dm-crypt do not have an endio function, and even if they do (such as dm-flakey), they don't modify the bio->bi_iter.bi_sector of the cloned bio that is used to update the orig_bio's bi_sector in dm_zone_endio function. Call dm_zone_endio for zoned devices after calling the target's endio function. Reviewed-by: Mike Snitzer <snitzer@kernel.org> Reviewed-by: Bart Van Assche <bvanassche@acm.org> Signed-off-by: Pankaj Raghav <p.raghav@samsung.com> --- drivers/md/dm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On Fri, Jan 06, 2023 at 09:33:17AM +0100, Pankaj Raghav wrote: > dm_zone_endio() updates the bi_sector of orig bio for zoned devices that > uses either native append or append emulation, and it is called before the > endio of the target. But target endio can still update the clone bio > after dm_zone_endio is called, thereby, the orig bio does not contain > the updated information anymore. > > Currently, this is not a problem as the targets that support zoned devices > such as dm-zoned, dm-linear, and dm-crypt do not have an endio function, > and even if they do (such as dm-flakey), they don't modify the > bio->bi_iter.bi_sector of the cloned bio that is used to update the > orig_bio's bi_sector in dm_zone_endio function. > > Call dm_zone_endio for zoned devices after calling the target's endio > function. This looks sensible, but I fail to see why we need this or how it fits into the earlier block layer part of the series.
On 2023-01-10 07:58, Christoph Hellwig wrote: > On Fri, Jan 06, 2023 at 09:33:17AM +0100, Pankaj Raghav wrote: >> dm_zone_endio() updates the bi_sector of orig bio for zoned devices that >> uses either native append or append emulation, and it is called before the >> endio of the target. But target endio can still update the clone bio >> after dm_zone_endio is called, thereby, the orig bio does not contain >> the updated information anymore. >> >> Currently, this is not a problem as the targets that support zoned devices >> such as dm-zoned, dm-linear, and dm-crypt do not have an endio function, >> and even if they do (such as dm-flakey), they don't modify the >> bio->bi_iter.bi_sector of the cloned bio that is used to update the >> orig_bio's bi_sector in dm_zone_endio function. >> >> Call dm_zone_endio for zoned devices after calling the target's endio >> function. > > This looks sensible, but I fail to see why we need this or how it fits > into the earlier block layer part of the series. > I just extracted the cleanup from my old series. Do you think it is better to send it as a separate patch instead of adding it along in this series?
On Tue, Jan 10, 2023 at 10:07:39AM +0100, Pankaj Raghav wrote: > I just extracted the cleanup from my old series. Do you think it is better > to send it as a separate patch instead of adding it along in this series? dm and block have different maintainers. So unless there is a dependency it's better to split the patches out.
diff --git a/drivers/md/dm.c b/drivers/md/dm.c index b424a6ee27ba..fdef74fe8bd1 100644 --- a/drivers/md/dm.c +++ b/drivers/md/dm.c @@ -1109,10 +1109,6 @@ static void clone_endio(struct bio *bio) disable_write_zeroes(md); } - if (static_branch_unlikely(&zoned_enabled) && - unlikely(bdev_is_zoned(bio->bi_bdev))) - dm_zone_endio(io, bio); - if (endio) { int r = endio(ti, bio, &error); switch (r) { @@ -1141,6 +1137,10 @@ static void clone_endio(struct bio *bio) } } + if (static_branch_unlikely(&zoned_enabled) && + unlikely(bdev_is_zoned(bio->bi_bdev))) + dm_zone_endio(io, bio); + if (static_branch_unlikely(&swap_bios_enabled) && unlikely(swap_bios_limit(ti, bio))) up(&md->swap_bios_semaphore);