X-Git-Url: http://git.tuebingen.mpg.de/?a=blobdiff_plain;f=dss.c;h=a3bda5330510e5290ef234d0a8e67b29a726461d;hb=f1aa445d6e57465d08b8a1ee6b9c87c9bb1d25f6;hp=07a60425170ddab063ee6071d4901993a9db8c62;hpb=90e4077abd237cfd03def4ea023a70ccd9167bcf;p=dss.git diff --git a/dss.c b/dss.c index 07a6042..a3bda53 100644 --- a/dss.c +++ b/dss.c @@ -606,9 +606,18 @@ static int try_to_free_disk_space(void) if (next_snapshot_is_due()) return 0; } + /* + * Idle and --keep_redundant not given, or low disk space. Look at + * existing snapshots. + */ dss_get_snapshot_list(&sl); ret = 0; - if (!low_disk_space && sl.num_snapshots <= 1) + /* + * Don't remove anything if there is free space and we have fewer + * snapshots than configured, plus one. This way there is always one + * snapshot that can be recycled. + */ + if (!low_disk_space && sl.num_snapshots <= 1 << conf.num_intervals_arg) goto out; why = "outdated"; victim = find_outdated_snapshot(&sl);