From 7b7a2d5d0019a542c25708359f3c238a56002e38 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Wed, 12 Aug 2026 15:03:15 +0200 Subject: [PATCH] Fail sync if snapshot setup fails on a supported filesystem --- cmdline/mingwapp.c | 2 +- cmdline/state.c | 7 ++++++- cmdline/unixapp.c | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/cmdline/mingwapp.c b/cmdline/mingwapp.c index 43b1a6f6..9d029588 100644 --- a/cmdline/mingwapp.c +++ b/cmdline/mingwapp.c @@ -437,7 +437,7 @@ int fssnapshot_mount(const char* dir, struct fssnapshot_struct* fss) if (wcscmp(fs_name, L"NTFS") == 0) magic = WINDOWS_NTFS_MAGIC; else - return -1; /* support only NTFS */ + return 1; /* support only NTFS */ /* * Obtain the canonical volume name: \\?\Volume{GUID}\ diff --git a/cmdline/state.c b/cmdline/state.c index 84867764..fb7e536d 100644 --- a/cmdline/state.c +++ b/cmdline/state.c @@ -5965,8 +5965,13 @@ int state_snapshot_scan(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_fatal(EINTERNAL, "Failed to setup snapshot for disk '%s'.\n", disk->name); + return -1; + } size_t root_len = strlen(disk->fss.root_dir); diff --git a/cmdline/unixapp.c b/cmdline/unixapp.c index 875a89cc..870c7005 100644 --- a/cmdline/unixapp.c +++ b/cmdline/unixapp.c @@ -2177,12 +2177,12 @@ int fssnapshot_mount(const char* path, struct fssnapshot_struct* fss) } else if (sfs.f_type == ZFS_SUPER_MAGIC) { return fssnapshot_zfs(path, ZFS_SUPER_MAGIC, fss); } else { - return -1; + return 1; } #else (void)path; (void)fss; - return -1; + return 1; #endif }