]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
When read-only volume found mark it in catalog -- fixes bug #2337
authorKern Sibbald <kern@sibbald.com>
Mon, 23 Oct 2017 17:22:52 +0000 (19:22 +0200)
committerEric Bollengier <eric@baculasystems.com>
Thu, 24 Mar 2022 08:02:59 +0000 (09:02 +0100)
bacula/src/stored/dev.h
bacula/src/stored/mount.c

index b077e42f4985fd637615c11a14c7a48008af7c8c..39e9c4ad02f67654dee0b81e27e185124bee6935 100644 (file)
@@ -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();
index f3c82a5e861dbb996b123f2d15c2c8e4ce9b2a98..6fc35baf2cbdd1bf784fd277a595c55f5c3fbeb2 100644 (file)
@@ -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.