Fail sync if snapshot setup fails on a supported filesystem

This commit is contained in:
Andrea Mazzoleni 2026-08-12 15:03:15 +02:00
parent 3f0c194a2f
commit 7b7a2d5d00
3 changed files with 9 additions and 4 deletions

View file

@ -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}\

View file

@ -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);

View file

@ -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
}