From: Kern Sibbald Date: Mon, 23 Oct 2017 17:22:52 +0000 (+0200) Subject: When read-only volume found mark it in catalog -- fixes bug #2337 X-Git-Tag: Release-11.3.2~807 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=19537f2c1cc85684d95f4a1b207cbbd387e3c682;p=thirdparty%2Fbacula.git When read-only volume found mark it in catalog -- fixes bug #2337 --- diff --git a/bacula/src/stored/dev.h b/bacula/src/stored/dev.h index b077e42f4..39e9c4ad0 100644 --- a/bacula/src/stored/dev.h +++ b/bacula/src/stored/dev.h @@ -864,6 +864,7 @@ public: bool mount_next_write_volume(); bool mount_next_read_volume(); void mark_volume_in_error(); + void mark_volume_read_only(); void mark_volume_not_inchanger(); int try_autolabel(bool opened); bool find_a_volume(); diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index f3c82a5e8..6fc35baf2 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -746,6 +746,23 @@ void DCR::mark_volume_in_error() dev->set_unload(); /* must get a new volume */ } +/* + * Mark volume read_only in catalog + */ +void DCR::mark_volume_read_only() +{ + Jmsg(jcr, M_INFO, 0, _("Marking Volume \"%s\" Read-Only in Catalog.\n"), + VolumeName); + dev->VolCatInfo = VolCatInfo; /* structure assignment */ + dev->setVolCatStatus("Read-Only"); + Dmsg0(150, "dir_update_vol_info. Set Read-Only.\n"); + dir_update_volume_info(this, false, false); + volume_unused(this); + Dmsg0(50, "set_unload\n"); + dev->set_unload(); /* must get a new volume */ +} + + /* * The Volume is not in the correct slot, so mark this * Volume as not being in the Changer.