From patchwork Wed Mar 30 01:32:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 12795397 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 9B7A7C433EF for ; Wed, 30 Mar 2022 01:32:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239656AbiC3BeD (ORCPT ); Tue, 29 Mar 2022 21:34:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53892 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241645AbiC3BeD (ORCPT ); Tue, 29 Mar 2022 21:34:03 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4AE11717AD for ; Tue, 29 Mar 2022 18:32:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1648603937; x=1680139937; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=l9tmb9UXT4IOr7YYICgArWiPg5ZIuz5QuTvT/5WNXGM=; b=WTPme7B6oTaTx5zNVZYgmuZP422if2cryROQz/d1ebL7V8LMHjeYeLVH SHGdVI+Bi/fdJp1kySTeMB/Y7J7f2sSSuZ5bNsMIHA1lK8zidQk0JE8W3 j7JJ0GVjeXG3XZGiavqUKTh6IzTknsKr1EtTIhm6h1a4E+k+vqfMtLz0h DKfmRQ+zm3OtZJO4nHKem+PzQmM0pzmMhSslq5aZUfP8UmWQqvLB45b45 LrjCN72qAqhMM1jT0gbI/j9SNtvHbM3aKzLY6OenqTJn0myrnjSqrmlfe pfgAdML2SqYxJASvirg/O8nX+hG20u278Y2hfn1n5mln7COpD9ZaysXZV Q==; X-IronPort-AV: E=Sophos;i="5.90,221,1643644800"; d="scan'208";a="201439143" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2022 09:32:17 +0800 IronPort-SDR: hgS8ASoHLj62Z8j/WmRnB5y+I5K9J46Qf/nIFf7BJZMGPoeNX6eVe4B0vfmkS8rg1A1sfGi/Q8 KrTKIuc3YvIp5Fodn+U7YftOKqsJoyf6EXvS0C39U3sLArtBAeTjWztmT0UvlYAdTRU642lC6o BeyHXzyggcKPVaz8niqNE3azRovnkelWgB24sZCeIJXLpLrprtxYaQkTB1biHF5Si5RK9yI9DV /q4bJJB1+uukryoqA/xOUXa5mBKcuGyFHd6qBKKDPRUHgplWuNOgkAJgcvARU9PzbjBhFIXyLW xaqTm2698xDexsiBLbBRR4dK Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2022 18:03:09 -0700 IronPort-SDR: sKt3vFkzn15HSLa6NiB6+fRgGCAfj+UfrS/cLTpboPO0O2CgjKeyxOwOEaAZjLPNlUrHLg4LAB YG+qXPWq5qIwbLo2hdcDawXREFpz4Oma1F4pvU+taR4JLnSjdqzrMIhUmEcSajURyE5tQz+7WX 5pzOiwULJq29nVUHsX3KsJpLo2m2UbrlzMWLFU6ZRd5XT5ulYWP0IGI0QDKzF18E+7IaDr1gF4 rhXsk7g3JbAAiD3XQpBnzR0kvKN92sPUoW8xADXmh9PtrSnEoJYDTopNNNZXujPCYYX4HVxXYE Ht8= 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; 29 Mar 2022 18:32:17 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Niklas Cassel , Shin'ichiro Kawasaki Subject: [PATCH blktests 1/6] zbd/008: check no stale page cache after BLKRESETZONE ioctl Date: Wed, 30 Mar 2022 10:32:10 +0900 Message-Id: <20220330013215.463555-2-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> References: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Run two processes which repeat data read and BLKRESETZONE ioctl, and check that the race does not leave stale page cache. This allows to catch the bug fixed with the commit e5113505904e ("block: Discard page cache of # zone reset target range"). Signed-off-by: Shin'ichiro Kawasaki --- tests/zbd/008 | 54 +++++++++++++++++++++++++++++++++++++++++++++++ tests/zbd/008.out | 2 ++ 2 files changed, 56 insertions(+) create mode 100755 tests/zbd/008 create mode 100644 tests/zbd/008.out diff --git a/tests/zbd/008 b/tests/zbd/008 new file mode 100755 index 0000000..c625bad --- /dev/null +++ b/tests/zbd/008 @@ -0,0 +1,54 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-3.0+ +# Copyright (C) 2022 Western Digital Corporation or its affiliates. +# +# Check stale page cache is not left after race between BLKZONERESET and data +# read. Regression test for commit e5113505904e ("block: Discard page cache of +# zone reset target range"). + +. tests/block/rc +. common/scsi_debug + +DESCRIPTION="check no stale page cache after BLKZONERESET and data read race" +TIMED=1 + +requires() { + _have_scsi_debug && _have_module_param scsi_debug zbc && + _have_program xfs_io +} + +test() { + local dev dump + echo "Running ${TEST_NAME}" + + rm -f "$FULL" + + # Create virtual device with zones + if ! _init_scsi_debug dev_size_mb=32 \ + zbc=host-managed zone_nr_conv=0; then + return 1 + fi + dev="/dev/${SCSI_DEBUG_DEVICES[0]}" + + # Run read workload + : "${TIMEOUT:=10}" + _run_fio --filename="$dev" --size="32M" --rw=randread \ + --norandommap --name=reads --time_based & + + while kill -0 $! 2>/dev/null; do + # Fill the device with known pattern + xfs_io -c "pwrite -S 0xaa -b 2M 0 32M" -d "$dev" >> "$FULL" + + # Data read should return zero data pattern after zone reset + blkzone reset "$dev" + dump=$(dd if="$dev" bs=4k 2>> "$FULL" | hexdump -e '"%x"') + if [[ $dump != "0*" ]]; then + echo "$dump" + break + fi + done + + _exit_scsi_debug + + echo "Test complete" +} diff --git a/tests/zbd/008.out b/tests/zbd/008.out new file mode 100644 index 0000000..08575bd --- /dev/null +++ b/tests/zbd/008.out @@ -0,0 +1,2 @@ +Running zbd/008 +Test complete From patchwork Wed Mar 30 01:32:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 12795398 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 2CECBC433FE for ; Wed, 30 Mar 2022 01:32:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241645AbiC3BeE (ORCPT ); Tue, 29 Mar 2022 21:34:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241652AbiC3BeD (ORCPT ); Tue, 29 Mar 2022 21:34:03 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 17E121717AB for ; Tue, 29 Mar 2022 18:32:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1648603939; x=1680139939; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=EszxiDgHYnH7YwyJ/BX+MIYqC4XsD+CrlqTw634rB8U=; b=TXrBb9flvXKT5y0h9XlMSusA2t/bMQAyULJz1ozWLz6UgB1Pk83kWfav jg8/O9zYRFHXyCboMt7hw8T9XxpUwWwSqkMhFDpxGhgAWWrqEwteccfnQ 4Drq4WzGb51J4FnMb6TGpiGejKrSPPpqDyq6KRsXkJzFYESMVb/Zf4gW3 /X0ycKen6zG8Qzf8mldItvWg5d/02E4FLTC1pLZxhMrUbTqqT7rXxdrDd fOsvISm4ba3CI6fatGx1A1tOXNtocfTjk/GtstWOttbs/As0LwdbuTxr/ i2c7p0KCA8WbPtumJ1m7ks2g7xvwo9+55bVnEMAdevy6tyen4qdrSvx4F g==; X-IronPort-AV: E=Sophos;i="5.90,221,1643644800"; d="scan'208";a="201439149" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2022 09:32:18 +0800 IronPort-SDR: jLwZJ2AA0zx1JUQuuR253Msox1S9vV83DKUF7C9kUqbGwsL72NYgwOe/mvb/5CK8GCDXlqVmG/ mZStDnpStOui2j77bRG55CW6UpKeLh8c+4zaRmIvogZAQEbx7BuvyRy6+CexRrf3CKWgsQIvbZ DW1IYw+tgcy0QA4MdE/joWkY3ln+GkGdRO1B86pSz90b7bqcXJgVwOCfcU3INoVLiJic3TR1aL e/25SZugxshZjKc2poz9zisHYpHyd51l9iosgGPr7PoDEp1/hWOn5QFIfmj2VGOw32gq45Pwp9 t2GMYCAmO07Y/Ur5afa66pkX Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2022 18:03:10 -0700 IronPort-SDR: TaltYC6Bmpu6SXysYiqCGQNUu1Ehv7TxfWx/uWgkz9nX7NrofFWZ+zV6MtrGNL9lwvPImRvjGG 3ziHtjz69Ut4wqlHusNekyzjrskd99QzQYLjwzHG8G1TDITcMGlZ6MaUCj0cYcdaTxdg88V0pA sLsIer/1/Ei0YjY5GT2dEyezSyYVfccOhYBEjjKvgJ7lyybocLrCdNU9/OEha+19Cvxz6KDitY ThdMSshLg20t8CTNSB5NZLTiGXQ63JXLBoXJCGeZxt/20M+O+g3xCYjzTw2HHSvnUWGLdr0CsD BBs= 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; 29 Mar 2022 18:32:19 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Niklas Cassel , Shin'ichiro Kawasaki Subject: [PATCH blktests 2/6] common/scsi_debug: prepare scsi_debug in zoned mode Date: Wed, 30 Mar 2022 10:32:11 +0900 Message-Id: <20220330013215.463555-3-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> References: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org To allow running tests using scsi_debug device with the zoned mode disabled (current setup) as well as enabled, modify the _init_scsi_debug helper function. When RUN_FOR_ZONED is set, specify zbc=host-managed parameter to scsi_debug module so that the scsi_debug devices are prepared in zoned mode. Signed-off-by: Shin'ichiro Kawasaki --- common/scsi_debug | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/common/scsi_debug b/common/scsi_debug index b48cdc9..95da14e 100644 --- a/common/scsi_debug +++ b/common/scsi_debug @@ -9,7 +9,16 @@ _have_scsi_debug() { } _init_scsi_debug() { - if ! modprobe -r scsi_debug || ! modprobe scsi_debug "$@"; then + local -a args=("$@") + + if (( RUN_FOR_ZONED )); then + if ! _have_module_param scsi_debug zbc; then + return + fi + args+=(zbc=host-managed zone_nr_conv=0) + fi + + if ! modprobe -r scsi_debug || ! modprobe scsi_debug "${args[@]}"; then return 1 fi From patchwork Wed Mar 30 01:32:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 12795399 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 DBCE4C433F5 for ; Wed, 30 Mar 2022 01:32:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241657AbiC3BeH (ORCPT ); Tue, 29 Mar 2022 21:34:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241653AbiC3BeF (ORCPT ); Tue, 29 Mar 2022 21:34:05 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4908B1717AB for ; Tue, 29 Mar 2022 18:32:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1648603940; x=1680139940; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4u3x3WEZDAD7nrSRLb+xiUKSPA5GHnKsjf85y8UlC+Y=; b=VDwy83CRfilQ9rW8lursIMdMzeDeyOAJBPpzR2q+ZI1a9Ae1ssu+5KKe LOOl9sUNmlXr+XLaJ2is0pKJaSYavJK9bGAb0c6pxahit1UAuRW+Rriuu UusasWfe0U7UDAtY24tMu6St5UIJWiWjkLgQbfucMhibdp6exTRR1Nq3m iaKGb0sQtrkbgQF2W51979DOoovbCH+miBTHgqBhyg4Ret7WTqO4KCtYh 7ThklLQPwoLK12QPcLY+4Tom1UnlfUoxXrFa7qMPUd17KcnH0Qj7yg4YK 5+XlWeeBbpKkwzmqXXE3Ntx/qcFhRbeCZyHTGRPa2iwmpVL7QTH08SvBs w==; X-IronPort-AV: E=Sophos;i="5.90,221,1643644800"; d="scan'208";a="201439154" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2022 09:32:20 +0800 IronPort-SDR: ZuExiDpTcxkpUI0J24Q5lX939QuXKjuJBVSTkIFrqj17oq0P5jTAwBydIMjWMyKn0DDz9I8DyD J2QF+EcV2NFgqZgqu6+tjQ6VN1O0OEkfiysrorYLTl83v+xe0yQgmWlNt9yYHv21EB3r3mLRbF OFmK8eUXojAMfTGVklYZrjsFCfcPWxnmW+IYU+jPLhb/CtlRynUq7dLHjtiYd8tKghSUyhjtt1 NYN8ZDUzXud5y+/24awQcEqd56bOk23Cvo3ckp1HnwcxbE4IhYFSjVJLBPSv5OvkBnbHS4jTVz iiRit2PmX0prctKm/x0PAmZH Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2022 18:03:12 -0700 IronPort-SDR: VGJLJ5wcsQ5ckXajnNuJ2hIv5X5RVLQXLcz7QOgxTy7fLQ8aumTJLztIO3QwrxWDu6xKKt7xrn fsHhWmz8ARDy6/idNBWtBw5PNGvqh6mHdcQfSHydXxCRcKPAHXNafzP17muPu0B4UiYL6hm105 zGzE9HnblY+bflwajqyNG4/xEnH4/SybaiQ7yaXPzE5NWWdoQxYXd+ORvckj3AP4gSqDO+sHN4 Qc753iuA4+JaHj2CEJk5bkyUmkVrNpbcM7xYsG3QvksuZst/1Ak+fCTw01IL5d/KB3WGDWCS/h V2U= 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; 29 Mar 2022 18:32:20 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Niklas Cassel , Shin'ichiro Kawasaki Subject: [PATCH blktests 3/6] block/027, scsi/004: whitelist scsi_debug test cases for zoned mode Date: Wed, 30 Mar 2022 10:32:12 +0900 Message-Id: <20220330013215.463555-4-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> References: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Define CAN_BE_ZONED=1 in block/027 and scsi/004. These test cases can be executed in zoned mode without problem against scsi_debug devices in zoned mode. Signed-off-by: Shin'ichiro Kawasaki --- tests/block/027 | 1 + tests/scsi/004 | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/block/027 b/tests/block/027 index e818bf7..b60f62c 100755 --- a/tests/block/027 +++ b/tests/block/027 @@ -16,6 +16,7 @@ DESCRIPTION="stress device hotplugging with running fio jobs and different schedulers" QUICK=1 +CAN_BE_ZONED=1 requires() { _have_cgroup2_controller io && _have_scsi_debug && _have_fio diff --git a/tests/scsi/004 b/tests/scsi/004 index 416117a..b5ef2dd 100755 --- a/tests/scsi/004 +++ b/tests/scsi/004 @@ -15,6 +15,7 @@ . common/scsi_debug DESCRIPTION="ensure repeated TASK SET FULL results in EIO on timing out command" +CAN_BE_ZONED=1 requires() { _have_scsi_debug From patchwork Wed Mar 30 01:32:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 12795400 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 80226C433EF for ; Wed, 30 Mar 2022 01:32:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241653AbiC3BeJ (ORCPT ); Tue, 29 Mar 2022 21:34:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54148 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241654AbiC3BeG (ORCPT ); Tue, 29 Mar 2022 21:34:06 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D0301717AD for ; Tue, 29 Mar 2022 18:32:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1648603941; x=1680139941; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=5aHkV6+rAGtYgGTmYFJdF85HBK6nztvzU0n+dzYbdIw=; b=Z4NyoYciJEEeKWMIIdwXCv26LwfZjd9SAcOoUjKonCLV8r/0bDU35COt 0yJtJ8h40eFkQpOgG89pND7ykVIQSe4FLX1neNYYtgT5uO2VAJmFyWxun rZIgF5dbsApqzLdwAdLLsMwIuxvOqRymkz0zNvdNw7EatZ4YzGJJ4f2pQ EBQIKtBta+n4N44HxcNE4eRTClhrkX1B2yrTZGGQQRNI4iEBdmtV1/11p tWqHSCmUePZ272U6XN8+xAVM5FnM7c28N8zNdvYibCNmIVJ+9OatBEqeQ Yua3BZeFbdf3aRuiFJ3YuX8V96cJYyV2hfCjo3NKHKCqGbY8IT13Gu1SA Q==; X-IronPort-AV: E=Sophos;i="5.90,221,1643644800"; d="scan'208";a="201439160" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2022 09:32:21 +0800 IronPort-SDR: m7/jtkPgAcYs82yEfxq6UQTDdzbbqWOEEgPrphcobZkeg0eRhVnJHbvBeDv3xF17J+fv7oRoD4 s625M0vsDwXA4dJtL5bDBf/1yc1qGg8Nk1uG4IkgLiM+6m/oWP1+NgHOYLuAb73ya9mfdh306p 0djBdAmDMl9K9L4zxX7u3ucHtIvWLoSYlNm7ba2/GqfYGLbhLaQdc3fiLHVgkDjl/0Ywn7a0aX qnvUFvI0uNW96pVt3U+Ugltl6idXDGQ53qc4zEkqyL/YVNH5ZNyMTYRso0Z5/ZlSh3LaDvU2Av Hg8OovKdStKJRP8QLYlautoN Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2022 18:03:13 -0700 IronPort-SDR: O01J147aaaYj8Rlz6pNwWpe96swyuQUQbGQkv4m7O2qXm5iEeODHNK/j4hrFCRDkrkZIFhmHyp xW69pznqWLurRUax6JezaZ08HXxuvK4Cdp8F14+9hscNnDeVBrU8hdqmc8rdEUyoaFC6kZ32Y3 1ABw2f+7DATvKVyEikkWe3eS2u/HWTFwNtrhq3GgH+cFjnNPfz/7qIAZTAjohtMIL/HljTepJt sqbGeEUMzfWaZj03tncBsW+JC8Ab3Hc7ILdxJIvyGTtFPh2ixt9E4NPdqUp9Jy/UbN018Cezv5 KME= 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; 29 Mar 2022 18:32:21 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Niklas Cassel , Shin'ichiro Kawasaki Subject: [PATCH blktests 4/6] scsi/006: whitelist for zoned mode Date: Wed, 30 Mar 2022 10:32:13 +0900 Message-Id: <20220330013215.463555-5-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> References: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Define CAN_BE_ZONED=1 in scsi/006. This test case can be executed without problem against zoned SCSI devices specified in TEST_DEVS, such as SMR HDDs. Signed-off-by: Shin'ichiro Kawasaki --- tests/scsi/006 | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/scsi/006 b/tests/scsi/006 index 05ed652..74df39d 100755 --- a/tests/scsi/006 +++ b/tests/scsi/006 @@ -10,6 +10,7 @@ DESCRIPTION="toggle SCSI cache type" QUICK=1 +CAN_BE_ZONED=1 device_requires() { _require_test_dev_is_scsi_disk From patchwork Wed Mar 30 01:32:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 12795401 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 A188FC4332F for ; Wed, 30 Mar 2022 01:32:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241654AbiC3BeL (ORCPT ); Tue, 29 Mar 2022 21:34:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54246 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241662AbiC3BeH (ORCPT ); Tue, 29 Mar 2022 21:34:07 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23631717AB for ; Tue, 29 Mar 2022 18:32:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1648603942; x=1680139942; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jwC8nlFbJTudjf2iGZWVEWkkspsXWBZD/gOpoJQ3smk=; b=fCmP1N0x+vy/F5Wbklo0g6WQw0MLbqD4tu6cCzkkKJnJWaUbPc8kQej7 zrA0yme09poP7y7AEY8HcgFwyUB+8fICayK3IUXgCSUMfYgi7QZtDWvss 9N/b4l7ZMZ1SrFn9yX1FBCIN62TPAU3JlelUN7rTXsnkyG9aVJEGdBzGK Qm/TQ6WmqRCL5wy+8Gj5+UUg8uqW59RDivIG285X6QHHjuLyBkbEHijCr BzyntO+gcytp6ujQH7pfIAi2yzqCe2HkzqpXdarStTkK77BIbMrRhTM7P R7qPKSh3y1dGyT3iaDJrc98FqEnergDX7l6LMmUm3yui/l3BFDtWgowV/ g==; X-IronPort-AV: E=Sophos;i="5.90,221,1643644800"; d="scan'208";a="201439168" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2022 09:32:22 +0800 IronPort-SDR: Nrv470lbnCTt2nFFS1spcqT2fDYU71pTU5kkAvhoTQBjN3aoSv93/MW6YXgOreStOQIwJHBK4V 3oDyYUimJTfslSEZ75L9cR9nTZGHRjgvxPwpXMSNFTwtzJw7j/40bjNDYkUBMYt/sRiD+z2dI3 /Wz4KZXbn3Vj2QhUv8ElZTk7mWB0y/PtGqN6l0b9qNAP8XiHzgMG2LN/XZOy4dXnlj+eB/tj15 b2rFFjFtBD+7i1yjk15KTv6BFXCAqDjnANOLiunHMgz1Y3QwRGtN+4kIKRnkmbQnCR0URrNjMZ lbmIBZOOW29ac48i6dSG8RPK Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2022 18:03:14 -0700 IronPort-SDR: rCeDuQ5ioGLvV2aNjN9bki8MHJDQATcMdx/37nx3/Tyt/clBjvU2HfxJhUpn2FC1wdSOekVkNc DMfegK3csEbB8tkpBljkLTbml7ZkZPY8UNJMnrwq5HCAkBhJmBD2tdnyeBsXAOc/M/Va6LomLf gjXQI28nTMz5i/FowLr7bC0mIq+CmHyuRR7/By+ShX6RH/ASVyR8X34F273Hlts+c//zVc+rk+ EDgkTZpRqTKMFDOq+SFdtosDyYmSm4JFTVXI1lweJ/XyzP2Sk9n0N1cQYfADGf7PwkOcO2kvdJ hwg= 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; 29 Mar 2022 18:32:22 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Niklas Cassel , Shin'ichiro Kawasaki Subject: [PATCH blktests 5/6] scsi/006: skip cache types which disable read cache for SATA drives Date: Wed, 30 Mar 2022 10:32:14 +0900 Message-Id: <20220330013215.463555-6-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> References: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case scsi/006 sets four cache types to test target SCSI devices. Two cache types out of the four, "none" and "write back, no read (daft)" disable read cache. However, these two types do not work for SATA drives since SAT specification requires Disable Read Cache is always set to zero in the caching mode page. It results in invalid argument error and the test case failure. To avoid the failure, skip the cache types which disable read cache if the test devices are SATA drives. To check the device, add a helper function _test_dev_is_sata in scsi/rc. Signed-off-by: Shin'ichiro Kawasaki --- tests/scsi/006 | 4 ++++ tests/scsi/rc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/tests/scsi/006 b/tests/scsi/006 index 74df39d..fe1d202 100755 --- a/tests/scsi/006 +++ b/tests/scsi/006 @@ -35,6 +35,10 @@ test_device() { original_cache_type="$(cat "$cache_type_path")" for cache_type in "${cache_types[@]}"; do echo "$cache_type" + # SAT requires Read Cache Disable always set to zero. + # Skip cache types which disable read cache for SATA drives. + _test_dev_is_sata && [[ $cache_type == none ]] || + [[ $cache_type =~ "no read" ]] && continue ( echo "$cache_type" > "$cache_type_path" ) |& grep -v "Invalid argument" if [[ ${PIPESTATUS[0]} -eq 0 ]]; then # If setting the cache type succeeded, it should now diff --git a/tests/scsi/rc b/tests/scsi/rc index 1477cec..c8d2f42 100644 --- a/tests/scsi/rc +++ b/tests/scsi/rc @@ -37,3 +37,7 @@ _require_test_dev_is_scsi_disk() { _get_test_dev_sg() { echo "${TEST_DEV_SYSFS}"/device/scsi_generic/sg* | grep -Eo "sg[0-9]+" } + +_test_dev_is_sata() { + [[ $(<"${TEST_DEV_SYSFS}"/device/vendor) == "ATA " ]] +} From patchwork Wed Mar 30 01:32:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shin'ichiro Kawasaki X-Patchwork-Id: 12795402 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 1698BC433FE for ; Wed, 30 Mar 2022 01:32:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241660AbiC3BeM (ORCPT ); Tue, 29 Mar 2022 21:34:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241652AbiC3BeI (ORCPT ); Tue, 29 Mar 2022 21:34:08 -0400 Received: from esa3.hgst.iphmx.com (esa3.hgst.iphmx.com [216.71.153.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC28A1717AD for ; Tue, 29 Mar 2022 18:32:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1648603943; x=1680139943; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=XAzmX4xniyZx8Scc22JYtqeWDtZGs52+W/w6pzMtJjA=; b=JmsT9qEXrsllnl1nwNIc6M4OuRE58xF9OFYtB5iwEOVqmUJUhR8YfrtO k9U8TS7n4hPq/h8y1onrxGMJyFSiTPTAXcYZX6azoCzoFgT4lqI+yCvKp q6xWyb44hu+up2YQeOSDlkVjU8jV2sXQXYUPVEj8HMjNWMi4tMueQd9n2 Js2UJRkTAqWwB+efEQ/QVzTpJ76V/dnWosoa7JWr0F8A0Akg2Lg9N15z7 YQItCQMYzQ2j03QR7CahACCCOIsykiuhebpCRY9J50BZibjhqWYD2Y8aE EGH9ec4OMKf0D/clbUBLKPi9JTI3rHJtLmrgPzsl5fmqzkHlEfAUFJSxW g==; X-IronPort-AV: E=Sophos;i="5.90,221,1643644800"; d="scan'208";a="201439171" Received: from uls-op-cesaip02.wdc.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 30 Mar 2022 09:32:23 +0800 IronPort-SDR: jbVjcVDvc9l4JHJoK9y5wahzSqFAbD7LjAnHwTOje5bYMNWrb9ZMsU70KP7by1Xx9Bxit0ZmLO lX8cbFrNp+WObJvGc7Tx2t9sZVAobW6RswHVZtcnCB0vPm9Tf4UO0BPW4vWh3kTIVup/HeXvuu j+jijlYvrHJnNVq91uod/VaSkC3nMmsE0rFEjqMXGUmOWDSIKr3K7SinkbrhOTwiCHJMz8Xf// QieeGErzQks0R+GWkSaWuz5jy0rJ013pQIrbVk9MRhK1yIxCwXiLxtJIZJ/wUC8GLnppmX9axW 8zG9rnrTDW+HkJz3eSzpFfFN Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 29 Mar 2022 18:03:15 -0700 IronPort-SDR: 5awH9RbjSLkzsVt9+zFO5Hbq7elEwwei6cX1c5WvrXPq31lxslCiQU0ZuUQP4Kab9Ysv12Q4TL ovukr5RqvLHSxwn/fNI7Eel7v1y+ub/WguooKxr1XUqrTNOQFS7dUpSkr7Pr9hS9+uEdFGOigQ lzB8yYGIhyc4LnSoNJsFFK9w7/ErXMxCd3I9DLHnGjG8uG2vhR//z1PBo6IPI0olE61mbZfvGK 2oGhAhsoSnnYk9i0iSU/iy5xpMea6FwBn+hUoTiR/Qw3USPEIi7CO9Cg3Ina7nnIkwprNGFZVU Gts= 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; 29 Mar 2022 18:32:23 -0700 From: Shin'ichiro Kawasaki To: linux-block@vger.kernel.org, Omar Sandoval Cc: Omar Sandoval , Damien Le Moal , Johannes Thumshirn , Niklas Cassel , Shin'ichiro Kawasaki Subject: [PATCH blktests 6/6] scsi/003: remove unnecessary out file Date: Wed, 30 Mar 2022 10:32:15 +0900 Message-Id: <20220330013215.463555-7-shinichiro.kawasaki@wdc.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> References: <20220330013215.463555-1-shinichiro.kawasaki@wdc.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org The test case scsi/003 was removed with the commit 5e803ca0ae99 ("Remove partition rereading tests for reverted fixes"), but its out file was left. Remove it. Signed-off-by: Shin'ichiro Kawasaki --- tests/scsi/003.out | 7 ------- 1 file changed, 7 deletions(-) delete mode 100644 tests/scsi/003.out diff --git a/tests/scsi/003.out b/tests/scsi/003.out deleted file mode 100644 index b9c2450..0000000 --- a/tests/scsi/003.out +++ /dev/null @@ -1,7 +0,0 @@ -Running scsi/003 -1 -1 -Operation not permitted -0 -0 -Test complete