From abcdd688dd98e41dd3c7efaa58c79c2dbeb49c2a Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Tue, 25 Aug 2026 22:39:56 +0200 Subject: [PATCH] Improve snapshot fallback warning messages to inform users of reduced recovery capability if files changed since the last sync --- cmdline/mingwapp.c | 2 +- cmdline/state.c | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cmdline/mingwapp.c b/cmdline/mingwapp.c index dbc11c70..77451a2c 100644 --- a/cmdline/mingwapp.c +++ b/cmdline/mingwapp.c @@ -434,7 +434,7 @@ static int windows_rebuild_link(const struct fssnapshot_struct* fss, const char* /* if no device path, assume snapshot absent */ if (device_path[0] == 0) { - log_error(0, "WARNING! Snapshot '%s' DeviceObject lost or removed externally.\n", name); + log_error(ENOENT, "WARNING! Snapshot '%s' DeviceObject lost or removed externally.\n", name); /* remove stale links */ windows_rmdir(guid_link); windows_rmdir(link_path); diff --git a/cmdline/state.c b/cmdline/state.c index 14946845..8b6261b2 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -6187,7 +6187,8 @@ void state_snapshot_read(struct snapraid_state* state) if (res > 0) continue; if (res < 0) { - log_error(0, "WARNING! Disk %s snapshot mount failed, falling back to live filesystem...\n", disk->name); + log_error(EUSER, "WARNING! Disk %s snapshot mount failed, falling back to live filesystem.\n", disk->name); + log_error(EUSER, "Recovery capability may be reduced if files have changed since the last successful sync.\n"); continue; } @@ -6200,7 +6201,8 @@ void state_snapshot_read(struct snapraid_state* state) msg_progress("Using disk %s stable snapshot...\n", disk->name); } else { /* fallback to standard mount point */ - log_error(0, "WARNING! Disk %s snapshot missing, falling back to live filesystem...\n", disk->name); + log_error(EUSER, "WARNING! Disk %s snapshot missing, falling back to live filesystem.\n", disk->name); + log_error(EUSER, "Recovery capability may be reduced if files have changed since the last successful sync.\n"); msg_progress("Using disk %s live filesystem...\n", disk->name); } } @@ -6226,7 +6228,8 @@ void state_snapshot_write(struct snapraid_state* state, tommy_list* filterlist_d if (res > 0) continue; if (res < 0) { - log_error(0, "WARNING! Disk %s snapshot mount failed, falling back to live filesystem...\n", disk->name); + log_error(EUSER, "WARNING! Disk %s snapshot mount failed, falling back to live filesystem.\n", disk->name); + log_error(EUSER, "Recovery capability may be reduced if files have changed since the last successful sync.\n"); continue; } @@ -6261,7 +6264,8 @@ void state_snapshot_write(struct snapraid_state* state, tommy_list* filterlist_d msg_progress("Using disk %s stable snapshot...\n", disk->name); } else { /* fallback to standard mount point */ - log_error(0, "WARNING! Disk %s snapshot missing, falling back to live filesystem...\n", disk->name); + log_error(EUSER, "WARNING! Disk %s snapshot missing, falling back to live filesystem.\n", disk->name); + log_error(EUSER, "Recovery capability may be reduced if files have changed since the last successful sync.\n"); msg_progress("Using disk %s live filesystem...\n", disk->name); } }