X-Git-Url: http://git.tuebingen.mpg.de/?p=dss.git;a=blobdiff_plain;f=dss.c;h=a9cdb3b8a590f91c3d5d9488e6d99c8831bd3f11;hp=cee49d68885d88abc8af991647905fd6c91f354d;hb=f05ae914bb3563ee657e4261ad0a7a8e80e8e9e7;hpb=d75434361fceedb4367a706e32442dd3a03a579c diff --git a/dss.c b/dss.c index cee49d6..a9cdb3b 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) @@ -568,7 +572,10 @@ static int handle_rm_exit(int status) snapshot_removal_status = HS_READY; return -E_BAD_EXIT_CODE; } - snapshot_removal_status = HS_SUCCESS; + if (conf.post_remove_hook_given) + snapshot_removal_status = HS_SUCCESS; + else + snapshot_removal_status = HS_READY; return 1; } @@ -634,7 +641,12 @@ static int handle_rsync_exit(int status) goto out; } es = WEXITSTATUS(status); - if (es == 13) { /* Errors with program diagnostics */ + /* + * Restart rsync on non-fatal errors: + * 12: Error in rsync protocol data stream + * 13: Errors with program diagnostics + */ + if (es == 12 || es == 13) { DSS_WARNING_LOG("rsync process %d returned %d -- restarting\n", (int)create_pid, es); snapshot_creation_status = HS_NEEDS_RESTART;