X-Git-Url: http://git.vrable.net/?a=blobdiff_plain;f=bluesky%2Fcleaner.c;h=a892e723473b7d1fd816e65f7745db347c8a1c65;hb=2dc3639e4e8d1efee451d1e29b51a09b9c3bdc91;hp=bd2b7f2b3e31ac996e1fd8f0afb26bb20dde82d0;hpb=388030970805a70cb4fad34ade5e3de7a3607a57;p=bluesky.git diff --git a/bluesky/cleaner.c b/bluesky/cleaner.c index bd2b7f2..a892e72 100644 --- a/bluesky/cleaner.c +++ b/bluesky/cleaner.c @@ -157,7 +157,7 @@ static BlueSkyCleanerItem *bluesky_cleaner_find_checkpoint(BlueSkyFS *fs) BlueSkyCleanerItem *checkpoint = bluesky_cleaner_deserialize(data); checkpoint->location.directory = BLUESKY_CLOUD_DIR_CLEANER; - checkpoint->location.directory = seq; + checkpoint->location.sequence = seq; bluesky_string_unref(data); return checkpoint; @@ -303,6 +303,12 @@ void bluesky_cleaner_merge(BlueSkyFS *fs) return; } + if (checkpoint->type != LOGTYPE_CHECKPOINT) { + g_warning("Last cleaner object not a checkpoint; cleaning probably in progress."); + bluesky_cleaner_item_free(checkpoint); + return; + } + /* Iterate over each of the inode map sections in the checkpoint */ for (int i = 0; i < checkpoint->links->len; i++) { BlueSkyCleanerLink *link = &g_array_index(checkpoint->links,