From 3d23853de7d4d1f096b9cbcb222d36054560d2fd Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 12 Aug 2026 15:22:23 +0200 Subject: [PATCH] Log explicit warning when missing snapshots fall back to live filesystem --- cmdline/mingwapp.c | 1 + cmdline/state.c | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/cmdline/mingwapp.c b/cmdline/mingwapp.c index 9d029588..671e4e73 100644 --- a/cmdline/mingwapp.c +++ b/cmdline/mingwapp.c @@ -373,6 +373,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); /* remove stale links */ windows_rmdir(guid_link); windows_rmdir(link_path); diff --git a/cmdline/state.c b/cmdline/state.c index fb7e536d..47a4927f 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -6082,8 +6082,13 @@ void state_snapshot_read(struct snapraid_state* state) struct snapraid_disk* disk = i->data; /* check if it supports snapshot */ - if (fssnapshot_mount(disk->mount_point, &disk->fss) != 0) + int res = fssnapshot_mount(disk->mount_point, &disk->fss); + if (res > 0) continue; + if (res < 0) { + log_error(0, "WARNING! Disk %s snapshot mount failed, falling back to live filesystem...\n", disk->name); + continue; + } size_t root_len = strlen(disk->fss.root_dir); @@ -6094,6 +6099,7 @@ 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); msg_progress("Using disk %s live filesystem...\n", disk->name); } } @@ -6115,8 +6121,13 @@ void state_snapshot_write(struct snapraid_state* state, tommy_list* filterlist_d struct snapraid_disk* disk = i->data; /* check if it supports snapshot */ - if (fssnapshot_mount(disk->mount_point, &disk->fss) != 0) + int res = fssnapshot_mount(disk->mount_point, &disk->fss); + if (res > 0) continue; + if (res < 0) { + log_error(0, "WARNING! Disk %s snapshot mount failed, falling back to live filesystem...\n", disk->name); + continue; + } size_t root_len = strlen(disk->fss.root_dir); @@ -6149,6 +6160,7 @@ 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); msg_progress("Using disk %s live filesystem...\n", disk->name); } }