From patchwork Tue Jul 13 10:12:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 12373445 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 C05EAC07E96 for ; Tue, 13 Jul 2021 10:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9C8346127C for ; Tue, 13 Jul 2021 10:12:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235199AbhGMKPc (ORCPT ); Tue, 13 Jul 2021 06:15:32 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:23428 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbhGMKPb (ORCPT ); Tue, 13 Jul 2021 06:15:31 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1626171162; x=1657707162; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=42Cpn3a1d7C3u8yTHao+Gwvp5aZGeSNxtykwiIrnhfM=; b=TihL5W708jqauRR/PzzOPz7wZMWABvwNaIkSqv5JsG9VZJxAqWKWTQ2i cImyErae9xwbGuSJn1DzoNp/lg4SGFzkFh765v/QeukZF5LTZ1kZWGCfe 1rWanoaLTDwYiiFstqx1MbbANmbZTCztrVjlDoqI1efl9sjQaTwavl/P9 XcKKeEHWZu4Nn+0JAjzCabLhzHJ2/AYHcg7zqxDZkWe7RA+dT9Cxq3UpQ kggYw+esiPQUgZsGCEBdAO0A/+ahhJarn66FyibQgDXY4Wfqd8ewEs7/h KFdATMC2CkgmIVuzO0sLX4FyGXJHHr0xJs30qRHovhXVVlmRb0NVpzJOk A==; IronPort-SDR: 9dZvRYv9TU9L8BkkRZgSTSkZbHFIqxmtnbG2A/hYrgRTWobiVOXGyBX+mpj1ccpTqg68LOohfA D/Is2C3CGFCctIDAk14Rff+8Ev//kwJ7DVKzwk1Qrz9H/cYIOxMPh9iVFtBmbyt69+5xQ6A8dt HkE2eAbqRCZ1msUGx8kHA292LzYZXOrFpjPmFaV8/wsJTOsDsHx8olefDbyoNukDyu8M/yqUAb VHL4OfuNBPAz//S4MOQI+bhHUxM16qFW59wDiIAcaQkB5uOLIUdDEUk7hTrLQ2utnEJlzlQjmL dis= X-IronPort-AV: E=Sophos;i="5.84,236,1620662400"; d="scan'208";a="173685550" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 13 Jul 2021 18:12:42 +0800 IronPort-SDR: Uxhpwtn8p1XJncbqLTUFK1mGHQZjl/T+bkODYUKZXiIHxQQYasW5PALRJn4XGO5q9HAqf4uPGR G3J8QLsLZc8H81MNTTI+x91OJJyYiRtcwo83SR/+PYKa7j8qMEW/eyH+8dNEmDZZX/j1tsb+K/ eRAnoTF8BzsqpTh/VhUne7556+ICrxkmLH/dXvriVG4Twz7Mggm1UxI2ub4+7g0iWzjIiCZHIb UaA6fvq0I79dX/mC3WwLwaubJsEOWGaU0fJVjlyzFM9IddHV1IY8dukshzoFOyq1CxKxh3l1fI 7Asd8/2CHsJTQwMuHZLv2XNV Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 02:49:25 -0700 IronPort-SDR: 0OVrERysPshwG6ZuKAxsLHdd96RqgelOcilK1ymFY7JO/YtdDSBfVAqQ7etSQHF2yfoaUfYSfn 86wv5kX1M7aj50I2OEnrvkrnXhRdCvL1oAenTfngwgg0lPqLmS7DwBlt16C0/W0R5wWxI+s9Pl FikxvfaXB+U/uRVD7lEKul713Dh+juUDZlvb7x9WkbEcSxROxlXlDfGglK7x2wgq1KwZoL636J u1FGPUvLG+SiJgpIOPy5QefFRgsQCdd88ItK9oVyE4xEoJGapX0J5eE/jmp60ZIfxinVK6rsCL Mf8= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.52.173]) by uls-op-cesaip02.wdc.com with ESMTP; 13 Jul 2021 03:12:42 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Chaitanya Kulkarni , Shinichiro Kawasaki Subject: [PATCH blktests 1/2] zbd/rc: Support dm-crypt Date: Tue, 13 Jul 2021 19:12:38 +0900 Message-Id: <20210713101239.269789-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210713101239.269789-1-shinichiro.kawasaki@wdc.com> References: <20210713101239.269789-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Linux kernel 5.9 added zoned block device support to dm-crypt. To test dm-crypt devices, modify the function _get_dev_container_and_sector(). To handle device-mapper table format difference between dm-crypt and dm-linear/flakey, add dev_idx and off_idx local variables. Signed-off-by: Shin'ichiro Kawasaki --- tests/zbd/rc | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/tests/zbd/rc b/tests/zbd/rc index 1237363..9deadc1 100644 --- a/tests/zbd/rc +++ b/tests/zbd/rc @@ -327,6 +327,7 @@ _get_dev_container_and_sector() { local cont_dev local -i offset local -a tbl_line + local -i dev_idx=3 off_idx=4 if _test_dev_is_partition; then offset=$(<"${TEST_DEV_PART_SYSFS}/start") @@ -340,13 +341,19 @@ _get_dev_container_and_sector() { return 1 fi if ! _test_dev_has_dm_map linear && - ! _test_dev_has_dm_map flakey; then - echo -n "dm mapping test other than linear/flakey is" + ! _test_dev_has_dm_map flakey && + ! _test_dev_has_dm_map crypt; then + echo -n "dm mapping test other than linear/flakey/crypt is" echo "not implemented" return 1 fi - # Parse dm table lines for dm-linear or dm-flakey target + if _test_dev_has_dm_map crypt; then + dev_idx=6 + off_idx=7 + fi + + # Parse dm table lines for dm-linear, dm-flakey or dm-crypt target while read -r -a tbl_line; do local -i map_start=${tbl_line[0]} local -i map_end=$((tbl_line[0] + tbl_line[1])) @@ -355,10 +362,11 @@ _get_dev_container_and_sector() { continue fi - offset=${tbl_line[4]} - if ! cont_dev=$(_get_dev_path_by_id "${tbl_line[3]}"); then + offset=${tbl_line[off_idx]} + if ! cont_dev=$(_get_dev_path_by_id \ + "${tbl_line[dev_idx]}"); then echo -n "Cannot access to container device: " - echo "${tbl_line[3]}" + echo "${tbl_line[dev_idx]}" return 1 fi From patchwork Tue Jul 13 10:12:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shinichiro Kawasaki X-Patchwork-Id: 12373447 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=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 ECCC4C11F66 for ; Tue, 13 Jul 2021 10:12:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF7CC61289 for ; Tue, 13 Jul 2021 10:12:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235278AbhGMKPd (ORCPT ); Tue, 13 Jul 2021 06:15:33 -0400 Received: from esa4.hgst.iphmx.com ([216.71.154.42]:23428 "EHLO esa4.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235143AbhGMKPd (ORCPT ); Tue, 13 Jul 2021 06:15:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1626171163; x=1657707163; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ypADBrW7wc3lsrMDgBijmF8Vc6XUNOz7b32iCAQOfg8=; b=DNfhJIMdDIHMXYzB5ipdD1jITYEW9ECk2OX4deFAWihJpQD1ZXsZwrvM jt7lBoFbwO5Z+ZvlaNEOj0/NCXX5UlEPwCb8s2oRT6mlCxksUewU8kI5W NpAGr11YG8VYPz8H//n77RNSbOVP5uPTvrI0cnJOUXmgZZzGvwvndjz9m +OKuroAtpK1mSHOW6aIkYdNejS8VkVwS5ndK2og2EVl7q8DA3eK66Ay8U dQnwLRa+GRKigMwmM15q13VH6SkIQ+CJGrGD8sNTV659Y1p1wkRgWwTLv Fzvg8Bk8T6hMDEOLzZoY/wxxLe9qrF8WD5jSHOiIGFvU4eNuEFTn4d+/Q Q==; IronPort-SDR: TrnO95G8GxGdGR+doF8SZAuiKmUUJkW7hRiv9JyBE5r9xl3XIQux1k16JBqB9OVup6kXW5ORn7 lgxX9RenH9pAE7XSoXQagGQcV9OP0Safh5WNKHMr6Hqu3f8hpB/a1PpiM4E+aTVohqANllid4n ZM6RTUCk4Y7uzLhjB1U+Yx/Hq015xKhSy3ngBHZcJIsUWJoO26DGwhMyX3K3rqYkD7zf4AEr6x NXfrmgSgYvQo8dihOXHzb90J82L4LeJDMg22N0qoG+m5953faEMoJ4TwQv1RqFWVpPLo01WjsE bY8= X-IronPort-AV: E=Sophos;i="5.84,236,1620662400"; d="scan'208";a="173685554" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 13 Jul 2021 18:12:43 +0800 IronPort-SDR: J56XBGiNRRJ5webe8FEeo2/gUHEDRCEdULFhznAlkwD3S7C/R2CmX1FSaLUY6X4+FcVEwIFXm2 riBOw1u3yKD/hqIvYZ5qgSWUiCTz2kvIqc9xtvqw1sB82QcszECbE2/VT98R5NShu961vIKbLJ a7vRnbRO1NFNy/HCHtOMNMCBzg0QqPWDwavVZyQtmWugzoIWY4sIU/BRK64xo/+CivDeLqA1XT WpdX83ubjEyTih0h/sXofctsf99o4brULah20PatboD7tyO37TW07ZE5YVli07+jWnYyuav0uX ZVtkuvwAGiZA3VXPS2F/qySK Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 13 Jul 2021 02:49:26 -0700 IronPort-SDR: lGBpPVlV1v+dgpvGenLJbN2XRggaiFrZrgQL+UuFQ64jgSmzdLop+o5e0KnGmuLnoUsIZQmjgF Evv/km8VimaBX+/ms2QY4bfS7nAoxRA222Mh7y5DGufnCMG5avGlP0YifV2sgoKdv6bGi/lJcL e1azstqUtcqr8xJ1jKvThHa5J+IBKd6eKyq4jFPDePt+F+wgdGxTzngFBKJtWkg3DLOw2J9k0i C/z1T7624qw0pffXY1nKb9EBlMhFAr4CDy82dGt7jEftWLiFnvBY7eRwAONge6vqKim/xa653a 3YI= WDCIronportException: Internal Received: from shindev.dhcp.fujisawa.hgst.com (HELO shindev.fujisawa.hgst.com) ([10.149.52.173]) by uls-op-cesaip02.wdc.com with ESMTP; 13 Jul 2021 03:12:43 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Chaitanya Kulkarni , Shinichiro Kawasaki Subject: [PATCH blktests 2/2] zbd/007: Reset test target zones at test end Date: Tue, 13 Jul 2021 19:12:39 +0900 Message-Id: <20210713101239.269789-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210713101239.269789-1-shinichiro.kawasaki@wdc.com> References: <20210713101239.269789-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case zbd/007 checks write pointer mapping between a logical device and its container device. To do so, it moves write pointers of the container device by writing data to the container device. When the logical device is a dm-crypt device, this test case works as expected, but the data written to the container device is not encrypted, then it leaves broken data on the logical, dm-crypt device. This results in I/O errors in the following operations to the dm-crypt device. To avoid the I/O errors, reset the test target zones of the logical device at the test case end to wipe out the broken data. Signed-off-by: Shin'ichiro Kawasaki --- tests/zbd/007 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tests/zbd/007 b/tests/zbd/007 index 9d7ca67..2179647 100755 --- a/tests/zbd/007 +++ b/tests/zbd/007 @@ -109,5 +109,12 @@ test_device() { done _put_blkzone_report + # When the logical devices is dm-crypt, the write pointer moves on + # its container device break data contents on the logical device. Reset + # zones of the logical device to wipe out the broken data. + for ((i=0; i < ${#test_z[@]}; i++)); do + blkzone reset -o "${test_z_start[i]}" -c 1 "${TEST_DEV}" + done + echo "Test complete" }