@@ -275,17 +275,13 @@ static void filter_dimm(struct ndctl_dimm *dimm, struct util_filter_ctx *fctx)
err(&monitor, "%s: no smart support\n", name);
return;
}
- if (!ndctl_dimm_is_cmd_supported(dimm, ND_CMD_SMART_THRESHOLD)) {
- err(&monitor, "%s: no smart threshold support\n", name);
- return;
- }
- if (!ndctl_dimm_is_flag_supported(dimm, ND_SMART_ALARM_VALID)) {
+ if (!ndctl_dimm_is_cmd_supported(dimm, ND_CMD_SMART_THRESHOLD)) {
+ dbg(&monitor, "%s: no smart threshold support\n", name);
+ } else if (!ndctl_dimm_is_flag_supported(dimm, ND_SMART_ALARM_VALID)) {
err(&monitor, "%s: smart alarm invalid\n", name);
return;
- }
-
- if (enable_dimm_supported_threshold_alarms(dimm)) {
+ } else if (enable_dimm_supported_threshold_alarms(dimm)) {
err(&monitor, "%s: enable supported threshold alarms failed\n", name);
return;
}
When a NVDIMM doesn't support ND_CMD_SMART_THRESHOLD, it may support ND_CMD_SMART or a variant of ND_CMD_SMART. Allow such a NVDIMM to work with "ndctl monitor". Signed-off-by: Dexuan Cui <decui@microsoft.com> --- ndctl/monitor.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)