We _must_ return non-zero if the remove was initiated. The old code
would exit with
try_to_free_disk_space: uhuhu: not enough disk space for a single snapshot
even though there are plenty of snapshots available that can be deleted.
static int remove_oldest_snapshot(struct snapshot_list *sl)
{
+ int ret;
struct snapshot *s = get_oldest_snapshot(sl);
if (!s) /* no snapshot found */
DSS_INFO_LOG("oldest snapshot: %s\n", s->name);
if (snapshot_is_being_created(s))
return 0;
- return pre_remove_hook(s, "oldest");
+ ret = pre_remove_hook(s, "oldest");
+ if (ret < 0)
+ return ret;
+ return 1;
}
static int rename_incomplete_snapshot(int64_t start)