On Mon, 2017-05-01 at 14:23 -0700, Dave Jiang wrote:
:
+++ b/Documentation/ndctl-clear-error.txt
@@ -0,0 +1,37 @@
+ndctl-clear-error(1)
+====================
+
+NAME
+----
+ndctl-clear-error - clear badblocks for a device
+
+SYNOPSIS
+--------
+[verse]
+'ndctl clear-error' [<options>]
+
+EXAMPLES
+--------
+
+Clear poison (bad blocks) for the provided device
+[verse]
+ndctl clear-error -f /dev/dax0.0 -s 0 -l 8
+
+Clear poison (bad blocks) at block offset 0 for 8 blocks on device
/dev/dax0.0
+
+OPTIONS
+-------
+-f::
+--file::
+ The device/file to be cleared of poison (bad blocks).
+
+-s::
+--start::
+ The offset where the poison (bad block) starts for this
device.
+ Typically this is acquired from the sysfs badblocks file.
+
+-l::
+--len::
+ The number of badblocks to clear in size of 512 bytes
increments.
+
When a specified range is larger than a badblock range, the command
completes with no-op without any message. I think it should either
fail with an error message or clear an inclusive badblock.
Thanks,
-Toshi