From c180015fdcb032b73e3cee2ff2a602a459872348 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 21 Jan 2026 14:47:26 +0100 Subject: [PATCH] Less confusing names of smartctl flags --- cmdline/device.c | 8 ++++---- cmdline/portable.h | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cmdline/device.c b/cmdline/device.c index 5e5a71d2..25264257 100644 --- a/cmdline/device.c +++ b/cmdline/device.c @@ -652,9 +652,9 @@ static void state_smart(struct snapraid_state* state, unsigned n, tommy_list* lo printf(" logfail"); else if (error_count != 0) { printf("%8" PRIu64, error_count); - } else if (flag & SMARTCTL_FLAG_ERROR) + } else if (flag & SMARTCTL_FLAG_ERROR_LOGGED) printf(" logerr"); - else if (flag & SMARTCTL_FLAG_ERROR_LOGGED) + else if (flag & SMARTCTL_FLAG_SELFERROR_LOGGED) printf(" selferr"); else printf(" -"); @@ -911,8 +911,8 @@ int devtest(tommy_list* high, tommy_list* low, int operation) case 7 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_FAIL; break; case 8 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_PREFAIL; break; case 9 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_PREFAIL_LOGGED; break; - case 10 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_ERROR; break; - case 11 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_ERROR_LOGGED; break; + case 10 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_ERROR_LOGGED; break; + case 11 : entry->smart[SMART_FLAGS] = SMARTCTL_FLAG_SELFERROR_LOGGED; break; } entry->power = POWER_ACTIVE; diff --git a/cmdline/portable.h b/cmdline/portable.h index c89d9e10..1dc635bc 100644 --- a/cmdline/portable.h +++ b/cmdline/portable.h @@ -488,8 +488,8 @@ int randomize(void* ptr, size_t size); #define SMARTCTL_FLAG_FAIL (1 << 3) /**< SMART status check returned "DISK FAILING". */ #define SMARTCTL_FLAG_PREFAIL (1 << 4) /**< We found prefail Attributes <= threshold. */ #define SMARTCTL_FLAG_PREFAIL_LOGGED (1 << 5) /**< SMART status check returned "DISK OK" but we found that some (usage or prefail) Attributes have been <= threshold at some time in the past. */ -#define SMARTCTL_FLAG_ERROR (1 << 6) /**< The device error log contains records of errors. */ -#define SMARTCTL_FLAG_ERROR_LOGGED (1 << 7) /**< The device self-test log contains records of errors. */ +#define SMARTCTL_FLAG_ERROR_LOGGED (1 << 6) /**< The device error log contains records of errors. */ +#define SMARTCTL_FLAG_SELFERROR_LOGGED (1 << 7) /**< The device self-test log contains records of errors. */ /** * SMART max attribute length.