From patchwork Thu Jun 28 22:13:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 10495297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 50D266022E for ; Thu, 28 Jun 2018 22:13:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3F08129D3C for ; Thu, 28 Jun 2018 22:13:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3320C29D62; Thu, 28 Jun 2018 22:13:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8FC4E29D3C for ; Thu, 28 Jun 2018 22:13:10 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DFDE7202E5475; Thu, 28 Jun 2018 15:13:09 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.24; helo=mga09.intel.com; envelope-from=vishal.l.verma@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B4FFB202E5403 for ; Thu, 28 Jun 2018 15:13:08 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 28 Jun 2018 15:13:08 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,285,1526367600"; d="scan'208";a="236446687" Received: from vverma7-desk1.lm.intel.com ([10.232.112.133]) by orsmga005.jf.intel.com with ESMTP; 28 Jun 2018 15:13:07 -0700 From: Vishal Verma To: Subject: [ndctl PATCH] ndctl, test: add start/wait scrub to injection tests Date: Thu, 28 Jun 2018 16:13:03 -0600 Message-Id: <20180628221303.3837-1-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.14.4 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.26 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP A number of tests that perform error injection were missing the start/wait scrub workaround needed for nfit_test namespaces, causing these tests to ocassionally fail. Fix it by starting and waiting for a scrub after injection in these remaining places. Cc: Dan Williams Signed-off-by: Vishal Verma Tested-by: Dan Williams --- test/btt-errors.sh | 2 ++ test/clear.sh | 1 + test/inject-error.sh | 1 + 3 files changed, 4 insertions(+) diff --git a/test/btt-errors.sh b/test/btt-errors.sh index e9cc209..cb35865 100755 --- a/test/btt-errors.sh +++ b/test/btt-errors.sh @@ -115,6 +115,7 @@ bb_inj=$((dataoff/512)) # inject badblocks for one page at the start of the file $NDCTL inject-error --block="$bb_inj" --count=8 $dev +$NDCTL start-scrub && $NDCTL wait-scrub force_raw 0 mount -o nodelalloc "/dev/$blockdev" $MNT @@ -148,6 +149,7 @@ map=$(hexdump -s 96 -n 4 "/dev/$raw_bdev" | head -1 | cut -d' ' -f2-) map=$(tr -d ' ' <<< "0x${map#* }${map%% *}") bb_inj=$((map/512)) $NDCTL inject-error --block="$bb_inj" --count=1 $dev +$NDCTL start-scrub && $NDCTL wait-scrub force_raw 0 # make sure reading the first block of the namespace fails diff --git a/test/clear.sh b/test/clear.sh index 6cc43db..17d5bed 100755 --- a/test/clear.sh +++ b/test/clear.sh @@ -41,6 +41,7 @@ err_sector="$(((size/512) / 2))" err_count=8 if ! read sector len < /sys/block/$blockdev/badblocks; then $NDCTL inject-error --block="$err_sector" --count=$err_count $dev + $NDCTL start-scrub && $NDCTL wait-scrub fi read sector len < /sys/block/$blockdev/badblocks [ $((sector * 2)) -ne $((size /512)) ] && echo "fail: $LINENO" && exit 1 diff --git a/test/inject-error.sh b/test/inject-error.sh index 7bda35b..49e68b3 100755 --- a/test/inject-error.sh +++ b/test/inject-error.sh @@ -77,6 +77,7 @@ do_tests() # inject normally $NDCTL inject-error --block=$err_block --count=$err_count $dev + $NDCTL start-scrub && $NDCTL wait-scrub check_status "$err_block" "$err_count" if read -r sector len < /sys/block/$blockdev/badblocks; then test "$sector" -eq "$err_block"