From: Kern Sibbald Date: Mon, 8 Jun 2020 07:49:23 +0000 (+0200) Subject: Fix orphaned buffers in cloud by adding truncate argument to end_of_job() X-Git-Tag: Release-9.6.4~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8ffeca285ba5c9a5edc42ae7a444ad018f3ad7ab;p=thirdparty%2Fbacula.git Fix orphaned buffers in cloud by adding truncate argument to end_of_job() --- diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index 87eac5c38..97782eb77 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -596,7 +596,7 @@ bool release_device(DCR *dcr) dev->Unlock(); } - dev->end_of_job(dcr); + dev->end_of_job(dcr, TRUNC_CONF_DEFAULT); if (dcr->keep_dcr) { dev->detach_dcr_from_dev(dcr); diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index 9990a50f3..fecd9359b 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -574,7 +574,7 @@ public: virtual bool weof(DCR *dcr, int num); /* in dev.c */ virtual bool end_of_volume(DCR *dcr) { return true; }; virtual bool start_of_job(DCR *dcr) {return true; }; - virtual bool end_of_job(DCR *dcr) {return true; }; + virtual bool end_of_job(DCR *dcr, uint32_t truncate) {Enter(50); return true; }; virtual bool is_indexed() { return true; }; virtual void set_ateof(); /* in dev.c */ virtual const char *print_type() = 0; /* in dev.c */ diff --git a/bacula/src/stored/dircmd.c b/bacula/src/stored/dircmd.c index 5bd044613..25360357d 100644 --- a/bacula/src/stored/dircmd.c +++ b/bacula/src/stored/dircmd.c @@ -624,6 +624,7 @@ static bool do_label(JCR *jcr, int relabel) dev->Unlock(); goto bail_out; } + /* ***FIXME*** truncate_option not implemented yet */ /* some command use recv and don't accept catalog update. * it's not the case here, so we force dir_update_volume_info catalog update */ @@ -907,7 +908,7 @@ static bool upload_cmd(JCR *jcr) ok = dev->upload_cache(dcr, volname, err); dev->part = 0; dev->close(dcr); - dev->end_of_job(dcr); + dev->end_of_job(dcr, TRUNC_CONF_DEFAULT); } } else if (dev->is_busy() || dev->is_blocked()) { send_dir_busy_message(dir, dev); @@ -919,7 +920,7 @@ static bool upload_cmd(JCR *jcr) ok = dev->upload_cache(dcr, volname, err); dev->part = 0; dev->close(dcr); - dev->end_of_job(dcr); + dev->end_of_job(dcr, TRUNC_CONF_DEFAULT); } } dev->max_concurrent_jobs = max_jobs; @@ -1088,7 +1089,7 @@ bail_out: dev->close(dcr); } - dev->end_of_job(dcr); + dev->end_of_job(dcr, TRUNC_CONF_DEFAULT); if (!dev->is_open()) { dev->clear_volhdr();