From: norbert.bizet Date: Tue, 7 Nov 2023 13:46:35 +0000 (-0500) Subject: All the rest: missing matching Leave() outside the cloud classes X-Git-Tag: Beta-15.0.1~49 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=66548274bffcbcbbb409c914897d7aba1d015079;p=thirdparty%2Fbacula.git All the rest: missing matching Leave() outside the cloud classes --- diff --git a/bacula/src/stored/block_util.c b/bacula/src/stored/block_util.c index da53d382d..3879474c2 100644 --- a/bacula/src/stored/block_util.c +++ b/bacula/src/stored/block_util.c @@ -793,6 +793,7 @@ bool terminate_writing_volume(DCR *dcr) Enter(dbglvl); if (dev->is_ateot()) { + Leave(dbglvl); return ok; /* already been here return now */ } diff --git a/bacula/src/stored/dev.c b/bacula/src/stored/dev.c index 2bd15cba8..97e5ecada 100644 --- a/bacula/src/stored/dev.c +++ b/bacula/src/stored/dev.c @@ -129,6 +129,7 @@ bool DEVICE::open_device(DCR *dcr, int omode) ASSERT2(!adata, "Attempt to open adata dev"); if (is_open()) { if (openmode == omode) { + Leave(dbglvl); return true; } else { Dmsg1(200, "Close fd=%d for mode change in open().\n", m_fd); @@ -148,6 +149,7 @@ bool DEVICE::open_device(DCR *dcr, int omode) if (openmode == OPEN_READ_WRITE && has_cap(CAP_STREAM)) { openmode = OPEN_WRITE_ONLY; } + Leave(dbglvl); return false; } @@ -377,8 +379,10 @@ bool DEVICE::mount(int timeout) { Enter(dbglvl); if (!is_mounted() && device->mount_command) { + Leave(dbglvl); return mount_file(1, timeout); } + Leave(dbglvl); return true; } @@ -391,8 +395,10 @@ bool DEVICE::unmount(int timeout) { Enter(dbglvl); if (is_mounted() && requires_mount() && device->unmount_command) { + Leave(dbglvl); return mount_file(0, timeout); } + Leave(dbglvl); return true; } @@ -963,6 +969,7 @@ bool DEVICE::eod(DCR *dcr) dev_errno = EBADF; Mmsg1(errmsg, _("Bad call to eod. Device %s not open\n"), print_name()); Dmsg1(100, "%s", errmsg); + Leave(dbglvl); return false; } diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index 9fe5e1449..518af9a0e 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -215,6 +215,7 @@ bail_out: if (save_adata) { dcr->set_adata(); /* switch back to what we entered with */ } + Leave(100); return ok; /* device locked */ } diff --git a/bacula/src/stored/file_dev.c b/bacula/src/stored/file_dev.c index 225a43b2e..ef749b520 100644 --- a/bacula/src/stored/file_dev.c +++ b/bacula/src/stored/file_dev.c @@ -87,6 +87,7 @@ bool DEVICE::rewind(DCR *dcr) file_addr = 0; if (m_fd < 0) { Mmsg1(errmsg, _("Rewind failed: device %s is not open.\n"), print_name()); + Leave(dbglvl); return false; } if (is_file()) { @@ -95,9 +96,11 @@ bool DEVICE::rewind(DCR *dcr) dev_errno = errno; Mmsg2(errmsg, _("lseek error on %s. ERR=%s.\n"), print_name(), be.bstrerror()); + Leave(dbglvl); return false; } } + Leave(dbglvl); return true; } diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index e0da0ea27..0d90cf1e5 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -599,6 +599,7 @@ bool DEVICE::rewrite_volume_label(DCR *dcr, bool recycle) } if (!load_encryption_key(dcr, "LABEL", dcr->VolumeName, &VolHdr.EncCypherKeySize, VolHdr.EncCypherKey, &VolHdr.MasterKeyIdSize, VolHdr.MasterKeyId)) { + Leave(100); return false; } if (!write_volume_label_to_block(dcr)) { @@ -873,6 +874,8 @@ void create_volume_header(DEVICE *dev, const char *VolName, if (chk_dbglvl(100)) { dev->dump_volume_label(); } + + Leave(130); } /* @@ -949,6 +952,7 @@ bool write_session_label(DCR *dcr, int label) if (!check_for_newvol_or_newfile(dcr)) { Pmsg0(000, "ERR: !check_for_new_vol_or_newfile\n"); dev->Unlock(); + Leave(100); return false; } diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 909025c24..3615e1f68 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -342,6 +342,7 @@ read_volume: dev->print_name()); V(mount_mutex); + Leave(200); return true; bail_out: diff --git a/bacula/src/stored/tape_dev.c b/bacula/src/stored/tape_dev.c index 9ffdeda24..889ddcc30 100644 --- a/bacula/src/stored/tape_dev.c +++ b/bacula/src/stored/tape_dev.c @@ -309,10 +309,12 @@ bool tape_dev::eod(DCR *dcr) Enter(100); ok = DEVICE::eod(dcr); if (!ok) { + Leave(100); return false; } #if defined (__digital__) && defined (__unix__) + Leave(100); return fsf(VolCatInfo.VolCatFiles); #endif