Skip to contentSkip to conversation

test/clear.sh: test to making sure cleared badblocks don't reappear

PATCH Superseded Vishal Verma 2 participants 2 messages Sep 30, 2016 libnvdimm: non-volatile memory device

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Vishal Verma

author maintainer
#0 lore raw

PATCH 1/1 test/clear.sh: test to making sure cleared badblocks don't reappear

Quoted 1 line

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.

---
 test/clear.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
test/clear.sh +10 -0
index 7765c10..336ee44 100755
@@ -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
Signature · 6 lines
2.7.4

_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm
#1 lore raw
Quoted 17 lines · Vishal Verma

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.

---
 test/clear.sh | 10 ++++++++++
 1 file changed, 10 insertions(+)
test/clear.sh +0 -0
index 7765c10..336ee44 100755
@@ -69,6 +69,16 @@ if read sector len < /sys/block/$blockdev/badblocks; then
        echo "fail: $LINENO" && exit 1
 fi
 

test/clear.sh if read sector len < /sys/block/$blockdev/badblocks; then · line 81

Quoted 10 lines
test/clear.sh +10 -0
+# 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
+

Hmm, can you gate this test by kernel version? I want to allow the unit test suite be run with expectations set to a specific kernel version. We have ndctl_test_attempt() for C tests, but for shell tests we'd want to use get_system_kver() which honors a "KVER" environment variable.
_______________________________________________
Linux-nvdimm mailing list
[email protected]
https://lists.01.org/mailman/listinfo/linux-nvdimm