]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix orphaned buffers in cloud by adding truncate argument to end_of_job()
authorKern Sibbald <kern@sibbald.com>
Mon, 8 Jun 2020 07:49:23 +0000 (09:49 +0200)
committerKern Sibbald <kern@sibbald.com>
Tue, 9 Jun 2020 12:25:27 +0000 (14:25 +0200)
bacula/src/stored/acquire.c
bacula/src/stored/dev.h
bacula/src/stored/dircmd.c

index 87eac5c38dc1c7852e57a1364bbfcc87c0a76f68..97782eb77c1942f782b0ba17c857c2cd1a97e2a4 100644 (file)
@@ -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);
index 9990a50f3259efd93d285fa010d56ac415d4dba4..fecd9359bc2f0944bfc5fc456d08319ace268468 100644 (file)
@@ -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 */
index 5bd0446136aec880ceb91077eb9ef506457438da..25360357d0db41d160dd82d7ecc327d3e7b83103 100644 (file)
@@ -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();