]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/block.c
Fix SD crash due to mismatched lock/unlock in error condition
[bacula/bacula] / bacula / src / stored / block.c
index 313a3dde6f84951cec79a69df9ac74edb53658eb..83c70b2c02ca143161bff9018331afac5a790b77 100644 (file)
@@ -947,7 +947,6 @@ bool read_block_from_dev(DCR *dcr, bool check_block_numbers)
    if (job_canceled(jcr)) {
       return false;
    }
-   ASSERT(dev->is_open());
    
    if (dev->at_eot()) {
       return false;
@@ -955,6 +954,9 @@ bool read_block_from_dev(DCR *dcr, bool check_block_numbers)
    looping = 0;
    Dmsg1(250, "Full read in read_block_from_device() len=%d\n",
          block->buf_len);
+
+// ASSERT(dev->is_open());
+
 reread:
    if (looping > 1) {
       dev->dev_errno = EIO;
@@ -965,22 +967,6 @@ reread:
       return false;
    }
    
-// #define lots_of_debug
-#ifdef lots_of_debug
-   if (dev->at_eof() && dev->is_dvd()) {
-      Dmsg1(100, "file_size=%u\n",(unsigned int)dev->file_size);
-      Dmsg1(100, "file_addr=%u\n",(unsigned int)dev->file_addr);
-      Dmsg1(100, "lseek=%u\n",(unsigned int)lseek(dev->fd(), 0, SEEK_CUR));
-      Dmsg1(100, "part_start=%u\n",(unsigned int)dev->part_start);
-      Dmsg1(100, "part_size=%u\n", (unsigned int)dev->part_size);
-      Dmsg2(100, "part=%u num_dvd_parts=%u\n", dev->part, dev->num_dvd_parts);
-      Dmsg1(100, "VolCatInfo.VolCatParts=%u\n", (unsigned int)dev->VolCatInfo.VolCatParts);
-      Dmsg3(100, "Tests : %d %d %d\n", (dev->VolCatInfo.VolCatParts > 0), 
-         ((dev->file_addr-dev->part_start) == dev->part_size), 
-         (dev->part <= dev->VolCatInfo.VolCatParts));
-  }
-#endif
-
    /* Check for DVD part file end */
    if (dev->at_eof() && dev->is_dvd() && dev->num_dvd_parts > 0 &&
         dev->part <= dev->num_dvd_parts) {