Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp1418771iog; Thu, 16 Jun 2022 06:06:23 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sWTEHA496xGyHyWR7p8fS52LIEDKaJo/Qg3RO7VkLRBPFSgiM/AT+g6QESQjv0cWg42lC0 X-Received: by 2002:a17:906:73d2:b0:716:14a4:43d with SMTP id n18-20020a17090673d200b0071614a4043dmr4389177ejl.434.1655384782708; Thu, 16 Jun 2022 06:06:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655384782; cv=none; d=google.com; s=arc-20160816; b=qknse7Sxj0Vu62JV3iClI46bOkupp5e3tKxkHG/mfjis/7s0KywOeJFLwIf+3miDo1 h4VnIxZFsOqGWM+3U16kwcxhq6633wdLYi+ofDqi8pgxQbsVIW8bNSedyVwjBORwqaoC ZpZuAV8BMNu9hyok5Q8NhJz5sYCzfRY0ebGBSCnO5uCYVxAdkEhJzPWdTM5x55sQmvGt EQa4BlY8ootgQgAWN92caGfLOukk9iL2E+GE3+PbZ2L5zR817Xn8xzRyGMsLIhR6mJ1s 5yojrhpzx+Pg+lB0/j2sCibySqxGXheOkCVusSCAjeu3e3RYEX/1Lutk6bqLBIReD6PF u89A== 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 :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=EKUY+sbN+QPb8jCu1lPBEVQGf66ETF7YiEyh0r6NbGA=; b=axU9+eghwuCijLjlsvvKfRSrhdZ2tNyURx7MtkOnfvtrPxIaVpHDk02RdYcZe0WwTL MwpNLlMuqzaIUfYklbYKX/LdThQd6uzkXtdGd7NrAz8pAOXynlTFkuU3yaP87nCydSzo K4D0iPDWNLac8Ygtct4mBddLqy78CrJs65pYGL8JE40eQKgW6fwy1ZzrW6EDcHXy5rYm 6x7rVnVRMiyDv/TbeXw+8KhQkNW4SmvADrEdSrnsUfd59Tslj/hH8pYAe87Cz20/Lr+J jBDkYIUcE8vj29j7y3laIzPSp9eNcucpCl3hhvFLCGnp4am6Qsj3nxbFK4eQ6ECfGD/w Erog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=JolLYBxC; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gs10-20020a1709072d0a00b007031f4e9894si1566189ejc.776.2022.06.16.06.05.55; Thu, 16 Jun 2022 06:06:22 -0700 (PDT) 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=JolLYBxC; 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 S233437AbiFPNB1 (ORCPT + 99 others); Thu, 16 Jun 2022 09:01:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229927AbiFPNB0 (ORCPT ); Thu, 16 Jun 2022 09:01:26 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EEC4B3DA58 for ; Thu, 16 Jun 2022 06:01:24 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220616122443euoutp01af03edbcdb792d68afaae7bf0180a4d5~5GWqJzL3u0863408634euoutp01j for ; Thu, 16 Jun 2022 12:24:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220616122443euoutp01af03edbcdb792d68afaae7bf0180a4d5~5GWqJzL3u0863408634euoutp01j DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1655382283; bh=EKUY+sbN+QPb8jCu1lPBEVQGf66ETF7YiEyh0r6NbGA=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=JolLYBxCavfmJJP3a9g833yTGgBJtyu0JRBu1yXDS1cTnAPyLmsts6IGglMCuesM9 NCpBejRZnHmycvDzVtCtByHVSXAF7me20PB23lPNE6CkEpWwgSUmMN51mvSLc3UUe9 3q7/GSkOBGzN8WCcNRdL4RqvPLJAsJiWZ4kmdgL4= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220616122442eucas1p2bbd7a238ca1a7768e7bfd4f18850cbba~5GWplods81908019080eucas1p2O; Thu, 16 Jun 2022 12:24:42 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 08.B2.09664.A012BA26; Thu, 16 Jun 2022 13:24:42 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220616122442eucas1p26a573d308772fd7c73d557fa46f91bdd~5GWpB-7160887408874eucas1p2D; Thu, 16 Jun 2022 12:24:42 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220616122442eusmtrp1ab6bc56c7b66c61af921bd62d07ef4b9~5GWpBKVwp2243722437eusmtrp1I; Thu, 16 Jun 2022 12:24:42 +0000 (GMT) X-AuditID: cbfec7f2-d81ff700000025c0-01-62ab210ab293 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AB.A4.09038.A012BA26; Thu, 16 Jun 2022 13:24:42 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20220616122442eusmtip2e36f8489d73ae998c241ba901b2f3d6b~5GWo21PBF2951229512eusmtip2_; Thu, 16 Jun 2022 12:24:42 +0000 (GMT) Received: from [192.168.1.12] (106.210.248.244) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 16 Jun 2022 13:24:36 +0100 Message-ID: <8d8501e8-9e39-8b02-d248-48f778a95d96@samsung.com> Date: Thu, 16 Jun 2022 14:24:33 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [dm-devel] [PATCH v7 12/13] dm: call dm_zone_endio after the target endio callback for zoned devices Content-Language: en-US To: Damien Le Moal , , , CC: , , , , , , , , , , , From: Pankaj Raghav In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.210.248.244] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrJKsWRmVeSWpSXmKPExsWy7djP87pciquTDHb/VLdYfbefzWLah5/M Fr/Pnme22PtuNqvFhR+NTBYrVx9lsniyfhazRc+BDywWf7vuAcVaHgKV3NK2uLxrDpvF/GVP 2S3W3HzKYtG28SujA7/H5SveHv9OrGHz2DnrLrvH5bOlHptWdbJ5LGyYyuyxeUm9x+6bDUC5 1vusHu/3XWXzWL/lKovH501yHu0HupkCeKO4bF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W4oxEQy3mouJEAHE+01yxAwAA X-CMS-MailID: 20220616122442eucas1p26a573d308772fd7c73d557fa46f91bdd X-Msg-Generator: CA X-RootMTR: 20220615102007eucas1p1106f9520e2a86beb3792107dffd8071b X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220615102007eucas1p1106f9520e2a86beb3792107dffd8071b References: <20220615101920.329421-1-p.raghav@samsung.com> <20220615101920.329421-13-p.raghav@samsung.com> X-Spam-Status: No, score=-10.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org On 2022-06-15 13:01, Damien Le Moal wrote: > On 6/15/22 19:19, 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. Call dm_zone_endio for zoned devices >> after calling the target's endio function >> >> Signed-off-by: Pankaj Raghav >> --- >> @Damien and @Hannes: I couldn't come up with a testcase that uses endio callback and >> zone append or append emulation for zoned devices to test for >> regression in this change. It would be great if you can suggest >> something. This change is required for the npo2 target as we update the >> clone bio sector in the endio callback function and the orig bio should >> be updated only after the endio callback for zone appends. > > Running zonefs tests on top of dm-crypt will exercise DM zone append > emulation. > Thanks. However, I am facing issues creating a dm-crypt target with a zoned device. Steps: - cryptsetup luksFormat is throwing a bunch of IO errors with the following error message: Device wipe error, offset 32768. Cannot wipe header on device . I can observe the same behavior in both v5.18 and next-20220615 with cryptsetup 2.4.3.The same step is working correctly on a normal NVMe device. Am I doing something wrong? ZNS info: zsze 128M and zcap 128M with 50 zones >> >> 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 3f17fe1de..3a74e1038 100644 >> --- a/drivers/md/dm.c >> +++ b/drivers/md/dm.c >> @@ -1025,10 +1025,6 @@ static void clone_endio(struct bio *bio) >> disable_write_zeroes(md); >> } >> >> - if (static_branch_unlikely(&zoned_enabled) && >> - unlikely(blk_queue_is_zoned(bdev_get_queue(bio->bi_bdev)))) >> - dm_zone_endio(io, bio); >> - >> if (endio) { >> int r = endio(ti, bio, &error); >> switch (r) { >> @@ -1057,6 +1053,10 @@ static void clone_endio(struct bio *bio) >> } >> } >> >> + if (static_branch_unlikely(&zoned_enabled) && >> + unlikely(blk_queue_is_zoned(bdev_get_queue(bio->bi_bdev)))) > > blk_queue_is_zoned(bdev_get_queue(bio->bi_bdev))) -> > bdev_is_zoned(bio->bi_bdev) > Ok. Even though I just moved the statements, I think this is trivial enough to take it along. >> + dm_zone_endio(io, bio); >> + >> if (static_branch_unlikely(&swap_bios_enabled) && >> unlikely(swap_bios_limit(ti, bio))) >> up(&md->swap_bios_semaphore); > >