]> git.sur5r.net Git - bacula/bacula/commitdiff
kes Fix seg fault in error exit of acquire_for_read after unsuccessfully
authorKern Sibbald <kern@sibbald.com>
Thu, 13 Sep 2007 15:13:10 +0000 (15:13 +0000)
committerKern Sibbald <kern@sibbald.com>
Thu, 13 Sep 2007 15:13:10 +0000 (15:13 +0000)
     trying to switch drives by checking for blocking before unblocking.
     Fixes bug #906.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@5545 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/stored/acquire.c
bacula/technotes-2.3

index 5736d70334c5fc084c967f19e41905e9525f327e..9bb22a78092f30eef3c796810a8f0a715d872f6d 100644 (file)
@@ -292,7 +292,14 @@ get_out:
       Dmsg2(50, "Dec reserve=%d dev=%s\n", dev->reserved_device, dev->print_name());
       dcr->reserved_device = false;
    }
-   dev->dunblock(DEV_LOCKED);
+   /* 
+    * Normally we are blocked, but in at least one error case above 
+    *   we are not blocked because we unsuccessfully tried changing
+    *   devices.  
+    */
+   if (dev->is_blocked()) {
+      dev->dunblock(DEV_LOCKED);
+   }
    Dmsg1(950, "jcr->dcr=%p\n", jcr->dcr);
    return ok;
 }
index 8154946c41e68d745b6c6ff1cae471a4d76efbd0..4ce2834e951b06a51056a85855d051e0e358efde 100644 (file)
@@ -2,6 +2,9 @@
 
 General:
 13Sep07
+kes  Fix seg fault in error exit of acquire_for_read after unsuccessfully
+     trying to switch drives by checking for blocking before unblocking.
+     Fixes bug #906.
 kes  Cancel storage daemon in all cases where FD reports error. This
      should fix virtually all cases of bug #920.
 kes  Fix db_escape_string() for MySQL which did not compile.