From patchwork Wed Jul 27 16:22:44 2022
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pankaj Raghav
X-Patchwork-Id: 12930561
Return-Path:
X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on
aws-us-west-2-korg-lkml-1.web.codeaurora.org
Received: from vger.kernel.org (vger.kernel.org [23.128.96.18])
by smtp.lore.kernel.org (Postfix) with ESMTP id 2E45CC04A68
for ; Wed, 27 Jul 2022 16:25:36 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S236203AbiG0QZc (ORCPT );
Wed, 27 Jul 2022 12:25:32 -0400
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50536 "EHLO
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S236449AbiG0QYX (ORCPT
);
Wed, 27 Jul 2022 12:24:23 -0400
Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com
[210.118.77.11])
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 435CB4E62B
for ;
Wed, 27 Jul 2022 09:23:19 -0700 (PDT)
Received: from eucas1p2.samsung.com (unknown [182.198.249.207])
by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id
20220727162258euoutp01e6d7bf1a1a8f97ed750d0aad3936634d~FvDZCG1cl2263722637euoutp01a
for ;
Wed, 27 Jul 2022 16:22:58 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com
20220727162258euoutp01e6d7bf1a1a8f97ed750d0aad3936634d~FvDZCG1cl2263722637euoutp01a
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;
s=mail20170921; t=1658938979;
bh=o0r9RyB9vOAXtqPhFs52TIGpjJ3od4KdTmNo2ZjXDoo=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=BCY2nrqvSVZvShtnBpRlxL1Eo1eK9cSI+xvAlVfHEklBFny/jMs45GlcoHB+CWcQw
ziQ6LTNWkma0byf9IApZ5gETGKysjfj8scQz5KXukJAdiEqxlt1gT94X16g1wggIvs
03Yk42m3gTZtqt5ghS0/Li5GJYWTwZqrOhTcBeBs=
Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by
eucas1p2.samsung.com (KnoxPortal) with ESMTP id
20220727162257eucas1p2ba22d6ac666789dc7c83c0c09c8dd771~FvDXYuC2n0838408384eucas1p2E;
Wed, 27 Jul 2022 16:22:57 +0000 (GMT)
Received: from eucas1p1.samsung.com ( [182.198.249.206]) by
eusmges3new.samsung.com (EUCPMTA) with SMTP id E9.E8.09580.16661E26;
Wed, 27
Jul 2022 17:22:57 +0100 (BST)
Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by
eucas1p2.samsung.com (KnoxPortal) with ESMTPA id
20220727162256eucas1p284a15532173cce3eca46eee0cee3acdd~FvDXATaOk2238722387eucas1p2n;
Wed, 27 Jul 2022 16:22:56 +0000 (GMT)
Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by
eusmtrp2.samsung.com (KnoxPortal) with ESMTP id
20220727162256eusmtrp23d991b641b5e5403010138b48180dea3~FvDW-f_cM0811608116eusmtrp20;
Wed, 27 Jul 2022 16:22:56 +0000 (GMT)
X-AuditID: cbfec7f5-9adff7000000256c-ed-62e166617204
Received: from eusmtip1.samsung.com ( [203.254.199.221]) by
eusmgms1.samsung.com (EUCPMTA) with SMTP id CD.1E.09095.06661E26;
Wed, 27
Jul 2022 17:22:56 +0100 (BST)
Received: from localhost (unknown [106.210.248.8]) by eusmtip1.samsung.com
(KnoxPortal) with ESMTPA id
20220727162256eusmtip1be6834eb505d89c9e19b839ab128d9cd~FvDWoSEpk0050700507eusmtip1i;
Wed, 27 Jul 2022 16:22:56 +0000 (GMT)
From: Pankaj Raghav
To: damien.lemoal@opensource.wdc.com, hch@lst.de, axboe@kernel.dk,
snitzer@kernel.org, Johannes.Thumshirn@wdc.com
Cc: matias.bjorling@wdc.com, gost.dev@samsung.com,
linux-kernel@vger.kernel.org, hare@suse.de,
linux-block@vger.kernel.org, pankydev8@gmail.com,
bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com,
linux-nvme@lists.infradead.org,
Pankaj Raghav
Subject: [PATCH v8 10/11] dm: call dm_zone_endio after the target endio
callback for zoned devices
Date: Wed, 27 Jul 2022 18:22:44 +0200
Message-Id: <20220727162245.209794-11-p.raghav@samsung.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20220727162245.209794-1-p.raghav@samsung.com>
MIME-Version: 1.0
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFrrOKsWRmVeSWpSXmKPExsWy7djPc7qJaQ+TDH6f4bRYfbefzWLah5/M
Fr/Pnme22PtuNqvFzQM7mSz2LJrEZLFy9VEmiyfrZzFb/O26x2Sx95a2xeVdc9gs5i97ym4x
oe0rs8XnpS3sFmtuPmWxOHFL2kHA4/IVb4+ds+6ye1w+W+qxaVUnm8fmJfUeu282sHnsbL3P
6vF+31U2j74tqxg9Np+u9vi8Sc6j/UA3UwBPFJdNSmpOZllqkb5dAlfGqWc/mAo2c1V8v7GZ
qYHxAEcXIyeHhICJxO/jk1i7GLk4hARWMErc6TnKBOF8YZToWdXNClIlJPCZUWJJkx9Mx/Zz
j6CKljNKPJv0iRmi6DmjxMQ3wl2MHBxsAloSjZ3sIGERgWKJh+9aWUDqmQVmMUmcPvaYGaRG
WCBF4kOnE0gNi4CqxI9595hAbF4Ba4nDP9+wQeySl5h56TvYHE6g+OYp86BqBCVOznzCAmIz
A9U0b53NDDJfQmA5p8TbD//ZQeZLCLhIfD0jDjFHWOLV8S3sELaMxP+d85kg7GqJpzd+Q/W2
MEr071zPBtFrLdF3JgfEZBbQlFi/Sx+i3FHiyKMJUBV8EjfeCkJcwCcxadt0Zogwr0RHmxBE
tZLEzp9PoJZKSFxumsMCYXtIvDh3nHECo+IsJL/MQvLLLIS9CxiZVzGKp5YW56anFh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l8ezBRzaIekGJkzOfsEDMl5do3jqbeQKjwCwkqVlIUgsYmVYxiqSWFuem
5xYb6hUn5haX5qXrJefnbmIERum2Yz8372Cc9+qj3iFGJg7GQ4wSHMxKIrwJ0feThHhTEiur
Uovy44tKc1KLDzGaAt09kVlKNDkfmCbySuINzQxMDU3MLA1MLc2MlcR5PQs6EoUE0hNLUrNT
UwtSi2D6mDg4pRqYZKbt4p879bvdx3Ct3saNzj7d6WVmr7f3/lVgFKxskTa8d9DxQWn0ph6G
GczNNbZN6tN9K52inc1Moz8ePbfIPndaye6qTyt0rPbkSiy426n47cXrxODeEplT5pwpOpcN
9xVXCl0Rkctzeb3FrU/VZ9oahpZwvu/HhBe3CrNslHos6Gl1Mo/FbP08273HZcVrnoefP608
fZNpxfToG0tunL7d/mrXx1mJWV8iNSc38m054XrRrvl6weKynwbpqnc3svy6O1HlrXC63q+4
pdzWyy54zH+16eIEe1uftZmi+mqmb98c1VKouJY+WfcY/37tqTtsPBIdrvqd4f5qUyl0ubQr
250xdcNb1eTQDmYlluKMREMt5qLiRABGGKl5WwMAAA==
X-CMS-MailID: 20220727162256eucas1p284a15532173cce3eca46eee0cee3acdd
X-Msg-Generator: CA
X-RootMTR: 20220727162256eucas1p284a15532173cce3eca46eee0cee3acdd
X-EPHeader: CA
CMS-TYPE: 201P
X-CMS-RootMailID: 20220727162256eucas1p284a15532173cce3eca46eee0cee3acdd
References: <20220727162245.209794-1-p.raghav@samsung.com>
Precedence: bulk
List-ID:
X-Mailing-List: linux-block@vger.kernel.org
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. Call dm_zone_endio for zoned devices
after calling the target's endio function
Signed-off-by: Pankaj Raghav
---
drivers/md/dm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/md/dm.c b/drivers/md/dm.c
index 03ac6143b8aa..bc410ee04004 100644
--- a/drivers/md/dm.c
+++ b/drivers/md/dm.c
@@ -1123,10 +1123,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) {
@@ -1155,6 +1151,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);