+
+ g_strfreev(result_argv);
+
+ if (taper && taper->disk && taper->result != LAST_TOK) {
+ if (taper->nb_dle >= conf_max_dle_by_volume) {
+ taper_cmd(CLOSE_VOLUME, dp, NULL, 0, NULL);
+ }
+ if(taper->dumper) {
+ if (taper->dumper->result != LAST_TOK) {
+ // Dumper already returned it's result
+ dumper_taper_result(taper->disk);
+ }
+ } else {
+ file_taper_result(taper->disk);
+ }
+ }
+
+ } while(areads_dataready(taper_fd));
+ start_some_dumps(&runq);
+ startaflush();
+}
+
+
+static void
+file_taper_result(
+ disk_t *dp)
+{
+ taper_t *taper;
+ char *qname = quote_string(dp->name);
+
+ taper = sched(dp)->taper;
+ if (taper->result == DONE) {
+ update_info_taper(dp, taper->first_label, taper->first_fileno,
+ sched(dp)->level);
+ }
+
+ sched(dp)->taper_attempted += 1;
+
+ if (taper->input_error) {
+ g_printf("driver: taper failed %s %s: %s\n",
+ dp->host->hostname, qname, taper->input_error);
+ if (strcmp(sched(dp)->datestamp, driver_timestamp) == 0) {
+ if(sched(dp)->taper_attempted >= 2) {
+ log_add(L_FAIL, _("%s %s %s %d [too many taper retries after holding disk error: %s]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level, taper->input_error);
+ g_printf("driver: taper failed %s %s, too many taper retry after holding disk error\n",
+ dp->host->hostname, qname);
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ } else {
+ log_add(L_INFO, _("%s %s %s %d [Will retry dump because of holding disk error: %s]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level, taper->input_error);
+ g_printf("driver: taper will retry %s %s because of holding disk error\n",
+ dp->host->hostname, qname);
+ if (dp->to_holdingdisk != HOLD_REQUIRED) {
+ dp->to_holdingdisk = HOLD_NEVER;
+ sched(dp)->dump_attempted -= 1;
+ headqueue_disk(&directq, dp);
+ } else {
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ }
+ }
+ } else {
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ }
+ } else if (taper->tape_error) {
+ g_printf("driver: taper failed %s %s with tape error: %s\n",
+ dp->host->hostname, qname, taper->tape_error);
+ if(sched(dp)->taper_attempted >= 2) {
+ log_add(L_FAIL, _("%s %s %s %d [too many taper retries]"),
+ dp->host->hostname, qname, sched(dp)->datestamp,
+ sched(dp)->level);
+ g_printf("driver: taper failed %s %s, too many taper retry\n",
+ dp->host->hostname, qname);
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ } else {
+ g_printf("driver: taper will retry %s %s\n",
+ dp->host->hostname, qname);
+ /* Re-insert into taper queue. */
+ headqueue_disk(&tapeq, dp);
+ }
+ } else if (taper->result != DONE) {
+ g_printf("driver: taper failed %s %s without error\n",
+ dp->host->hostname, qname);
+ } else {
+ delete_diskspace(dp);
+ amfree(sched(dp)->destname);
+ amfree(sched(dp)->dumpdate);
+ amfree(sched(dp)->degr_dumpdate);
+ amfree(sched(dp)->degr_mesg);
+ amfree(sched(dp)->datestamp);
+ amfree(dp->up);
+ }
+
+ amfree(qname);
+
+ taper->state &= ~TAPER_STATE_FILE_TO_TAPE;
+ taper->state |= TAPER_STATE_IDLE;
+ amfree(taper->input_error);
+ amfree(taper->tape_error);
+ taper->disk = NULL;
+ taper_nb_wait_reply--;
+ if (taper_nb_wait_reply == 0) {
+ event_release(taper_ev_read);
+ taper_ev_read = NULL;
+ }
+
+ /* continue with those dumps waiting for diskspace */
+ continue_port_dumps();
+ start_some_dumps(&runq);
+ startaflush();