ndctl: add a 'clear-errors' command
Subsystems (2)
Vishal Verma
maintainerPATCH 1/1 ndctl: add a 'clear-errors' command
Add a nre command, ndctl-clear-errors, to clear any errors (badblocks) on a namespace. This is in preparation for a 'system-ram' mode for devdax devices using the kernel's 'kmem' facility. Since the device is being used as volatile RAM, we can take the opportunity to clear any badblocks on the device before reconfiguration, so that the user doesn't come across one unexpectedly.
Make this error clearing facility generic to all namespace types (i.e. devdax, fsdax, and raw; sector mode namespaces are not supported). To clear errors, use the "Clear Uncorrectable Errors" ACPI DSM command via the helpers provided by libndctl.
--- Documentation/ndctl/Makefile.am | 1 + Documentation/ndctl/ndctl-clear-errors.txt | 106 ++++++++ contrib/ndctl | 3 + ndctl/action.h | 1 + ndctl/builtin.h | 1 + ndctl/namespace.c | 279 +++++++++++++++++++++ ndctl/ndctl.c | 1 + 7 files changed, 392 insertions(+) create mode 100644 Documentation/ndctl/ndctl-clear-errors.txt
Documentation/ndctl/Makefile.am +1 -0
@@ -43,6 +43,7 @@ man1_MANS = \ ndctl-create-namespace.1 \ ndctl-destroy-namespace.1 \ ndctl-check-namespace.1 \ + ndctl-clear-errors.1 \ ndctl-inject-error.1 \ ndctl-inject-smart.1 \ ndctl-update-firmware.1 \
Documentation/ndctl/ndctl-clear-errors.txt new file +106 -0
106 lines not on this page · raw message
contrib/ndctl +3 -0
@@ -328,6 +328,9 @@ __ndctl_comp_non_option_args() check-namespace) opts="$(__ndctl_get_ns -i) all" ;; + clear-errors) + opts="$(__ndctl_get_ns) all" + ;; enable-region) opts="$(__ndctl_get_regions -i) all" ;;
ndctl/action.h +1 -0
@@ -13,5 +13,6 @@ enum device_action {ACTION_CHECK ,ACTION_WAIT ,ACTION_START , + ACTION_CLEAR, };#endif /* __NDCTL_ACTION_H__ */
ndctl/builtin.h +1 -0
@@ -10,6 +10,7 @@ int cmd_create_namespace(int argc, const char **argv, struct ndctl_ctx *ctx);int cmd_destroy_namespace (int argc,const char **argv,struct ndctl_ctx *ctx);int cmd_disable_namespace (int argc,const char **argv,struct ndctl_ctx *ctx);int cmd_check_namespace (int argc,const char **argv,struct ndctl_ctx *ctx); +int cmd_clear_errors (int argc,const char **argv,struct ndctl_ctx *ctx);int cmd_enable_region (int argc,const char **argv,struct ndctl_ctx *ctx);int cmd_disable_region (int argc,const char **argv,struct ndctl_ctx *ctx);int cmd_enable_dimm (int argc,const char **argv,struct ndctl_ctx *ctx);
ndctl/namespace.c +279 -0
318 lines not on this page · raw message
ndctl/ndctl.c +1 -0
@@ -74,6 +74,7 @@ static struct cmd_struct commands[] = { { "create-namespace", { cmd_create_namespace } }, { "destroy-namespace", { cmd_destroy_namespace } }, { "check-namespace", { cmd_check_namespace } }, + { "clear-errors", { cmd_clear_errors } }, { "enable-region", { cmd_enable_region } }, { "disable-region", { cmd_disable_region } }, { "enable-dimm", { cmd_enable_dimm } },
Signature · 6 lines
2.20.1 _______________________________________________ Linux-nvdimm mailing list [email protected] https://lists.01.org/mailman/listinfo/linux-nvdimm