From: Andre Noll Date: Tue, 5 May 2009 08:53:43 +0000 (+0200) Subject: Fix return value of remove_oldest_snapshot(). X-Git-Tag: v0.1.3~11 X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=commitdiff_plain;h=97790d7fa5e13c61c95d1a48e1520ac00a983768 Fix return value of remove_oldest_snapshot(). 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. --- diff --git a/dss.c b/dss.c index c0597f3..27c14b6 100644 --- a/dss.c +++ b/dss.c @@ -367,6 +367,7 @@ static int remove_outdated_snapshot(struct snapshot_list *sl) static int remove_oldest_snapshot(struct snapshot_list *sl) { + int ret; struct snapshot *s = get_oldest_snapshot(sl); if (!s) /* no snapshot found */ @@ -374,7 +375,10 @@ static int remove_oldest_snapshot(struct snapshot_list *sl) 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)