Ignore any snapshot directory with creation time > completion time.
authorAndre Noll <maan@systemlinux.org>
Thu, 6 Nov 2008 08:52:28 +0000 (09:52 +0100)
committerAndre Noll <maan@systemlinux.org>
Thu, 6 Nov 2008 08:52:28 +0000 (09:52 +0100)
Without this fix, dss would abort du to an assertion in dss.c:

dss.c:171: compute_next_snapshot_time: Assertion `x >= 0' failed.

Thanks to Sebastian Stark for pointing out this flaw.

snap.c

diff --git a/snap.c b/snap.c
index 89d6004..1fab237 100644 (file)
--- a/snap.c
+++ b/snap.c
@@ -101,7 +101,7 @@ static int is_snapshot(const char *dirname, int64_t now, int unit_interval,
        free(tmp);
        if (ret < 0)
                return 0;
-       if (num > now)
+       if (num > now || num < s->creation_time)
                return 0;
        s->completion_time = num;
        s->flags = SS_COMPLETE;