From patchwork Fri Sep 30 20:10:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Verma, Vishal L" X-Patchwork-Id: 9358839 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 87BD36075E for ; Fri, 30 Sep 2016 20:11:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B3A42A01B for ; Fri, 30 Sep 2016 20:11:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 702022A17B; Fri, 30 Sep 2016 20:11:21 +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=0.8 required=2.0 tests=BAYES_50, 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 C4B012A01B for ; Fri, 30 Sep 2016 20:11:20 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id B67001A1DF7; Fri, 30 Sep 2016 13:11:20 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) (using TLSv1 with cipher CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id EC3FE1A1DF7 for ; Fri, 30 Sep 2016 13:11:19 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 30 Sep 2016 13:11:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,274,1473145200"; d="scan'208,223";a="1064607827" Received: from omniknight.lm.intel.com ([10.232.112.53]) by fmsmga002.fm.intel.com with ESMTP; 30 Sep 2016 13:11:19 -0700 From: Vishal Verma To: Subject: [ndctl PATCH] test/clear.sh: test to making sure cleared badblocks don't reappear Date: Fri, 30 Sep 2016 14:10:32 -0600 Message-Id: <1475266232-18680-1-git-send-email-vishal.l.verma@intel.com> X-Mailer: git-send-email 2.7.4 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.21 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 From v4.9 onwards, cleared badblocks won't reappear on an ARS or simply after disabling/re-enabling a namespace. Add a test to make sure this doesn't regress. Signed-off-by: Vishal Verma --- test/clear.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/test/clear.sh b/test/clear.sh index 7765c10..336ee44 100755 --- a/test/clear.sh +++ b/test/clear.sh @@ -69,6 +69,16 @@ if read sector len < /sys/block/$blockdev/badblocks; then echo "fail: $LINENO" && exit 1 fi +# check for re-appearance of stale badblocks from poison_list +$NDCTL disable-region $BUS all +$NDCTL enable-region $BUS all + +# since we have cleared the errors, a disable/reenable shouldn't bring them back +if read sector len < /sys/block/$blockdev/badblocks; then + # fail if reading badblocks returns data + echo "fail: $LINENO" && exit 1 +fi + $NDCTL disable-region $BUS all $NDCTL disable-region $BUS1 all modprobe -r nfit_test