]> git.tuebingen.mpg.de Git - dss.git/blobdiff - dss.c
prune Simplify rm exit code logic.
[dss.git] / dss.c
diff --git a/dss.c b/dss.c
index 537c2430f7b18f7f5f6809fd270993ee800ba6b9..126c366d99f89b1c9ae5c1e5fb89672fd14f87b9 100644 (file)
--- a/dss.c
+++ b/dss.c
@@ -651,6 +651,7 @@ static struct snapshot *find_oldest_removable_snapshot(struct snapshot_list *sl)
        int i, num_complete;
        struct snapshot *s, *ref = NULL;
 
+       DSS_DEBUG_LOG(("picking snapshot with earliest creation time\n"));
        num_complete = num_complete_snapshots(sl);
        if (num_complete <= OPT_UINT32_VAL(DSS, MIN_COMPLETE))
                return NULL;
@@ -661,7 +662,6 @@ static struct snapshot *find_oldest_removable_snapshot(struct snapshot_list *sl)
                        ref = s;
                        continue;
                }
-               DSS_INFO_LOG(("oldest removable snapshot: %s\n", s->name));
                return s;
        }
        assert(ref);
@@ -1686,11 +1686,9 @@ rm:
        ret = wait_for_remove_process();
        if (ret < 0)
                goto out;
-       if (snapshot_removal_status != HS_SUCCESS)
-               goto out;
+       assert(snapshot_removal_status == HS_SUCCESS);
        post_remove_hook();
-       if (snapshot_removal_status != HS_POST_RUNNING)
-               goto out;
+       assert(snapshot_removal_status == HS_POST_RUNNING);
        ret = wait_for_remove_process();
        if (ret < 0)
                goto out;