From 94e71365b85e8d90fc7393fc87b91e2cd0c32fcc Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 20 Jan 2026 23:52:13 +0100 Subject: [PATCH] Use "warning" for less relevant errors in the final exit status --- TODO | 4 ++++ cmdline/scrub.c | 2 +- cmdline/sync.c | 2 +- doc/snapraid_log.1 | 6 +++--- doc/snapraid_log.d | 6 +++--- doc/snapraid_log.txt | 4 ++-- 6 files changed, 14 insertions(+), 10 deletions(-) diff --git a/TODO b/TODO index 876a3f25..970b2e2b 100644 --- a/TODO +++ b/TODO @@ -7,6 +7,10 @@ This is the list of TODO items for SnapRAID. * Integration with MergeFS ? +* Check Reliability Test +https://github.com/linuxhw/SMART +https://github.com/linuxhw/EnterpriseDrive + * Support BTRFS subvolumes. Keep track of the subvolumeid, along with the inode, and use it when searching/comparing inodes. The value 0 can be used for the root volume, like a normal filesystem. See: https://github.com/kdave/btrfs-progs/tree/master/libbtrfsutil diff --git a/cmdline/scrub.c b/cmdline/scrub.c index 85cd735b..e0a7168d 100644 --- a/cmdline/scrub.c +++ b/cmdline/scrub.c @@ -704,7 +704,7 @@ end: if (error + silent_error + io_error == 0) log_tag("summary:exit:ok\n"); else if (silent_error + io_error == 0) - log_tag("summary:exit:alert\n"); + log_tag("summary:exit:warning\n"); else log_tag("summary:exit:error\n"); log_flush(); diff --git a/cmdline/sync.c b/cmdline/sync.c index 0fabd80d..19f4e7a3 100644 --- a/cmdline/sync.c +++ b/cmdline/sync.c @@ -1425,7 +1425,7 @@ end: if (error + silent_error + io_error == 0) log_tag("summary:exit:ok\n"); else if (silent_error + io_error == 0) - log_tag("summary:exit:alert\n"); + log_tag("summary:exit:warning\n"); else log_tag("summary:exit:error\n"); log_flush(); diff --git a/doc/snapraid_log.1 b/doc/snapraid_log.1 index 82b7e4bf..2dc72cc6 100644 --- a/doc/snapraid_log.1 +++ b/doc/snapraid_log.1 @@ -1012,9 +1012,9 @@ one of the following: .I ok No issues. The array is fully synchronized and healthy. .HP 4 -.I alert -Incomplete. Some files were skipped due to modifications -during execution or permission issues. No hardware risk. +.I warning +Some files were skipped due to modifications during +execution or permission issues. No hardware risk. .HP 4 .I error Critical failure. Indicates serious issues like I/O failures diff --git a/doc/snapraid_log.d b/doc/snapraid_log.d index 5cce900c..3b530728 100644 --- a/doc/snapraid_log.d +++ b/doc/snapraid_log.d @@ -666,10 +666,10 @@ Command Sync/Scrub Tags =summary:exit: Logs the overall exit status of the command. The `status` is one of the following: - + ok - No issues. The array is fully synchronized and healthy. - alert - Incomplete. Some files were skipped due to modifications - during execution or permission issues. No hardware risk. + warning - Some files were skipped due to modifications during + execution or permission issues. No hardware risk. error - Critical failure. Indicates serious issues like I/O failures or silent data corruption. Requires immediate hardware or filesystem inspection. diff --git a/doc/snapraid_log.txt b/doc/snapraid_log.txt index f63f34d1..ddfe90cc 100644 --- a/doc/snapraid_log.txt +++ b/doc/snapraid_log.txt @@ -696,8 +696,8 @@ These tags provide summary statistics at the end of the command. one of the following: ok - No issues. The array is fully synchronized and healthy. - alert - Incomplete. Some files were skipped due to modifications - during execution or permission issues. No hardware risk. + warning - Some files were skipped due to modifications during + execution or permission issues. No hardware risk. error - Critical failure. Indicates serious issues like I/O failures or silent data corruption. Requires immediate hardware or filesystem inspection.