]> git.sur5r.net Git - bacula/bacula/commitdiff
block.c:do_dvd_size_checks: Check we are writing to a dvd before doing
authorNicolas Boichat <nicolas@boichat.ch>
Wed, 19 Oct 2005 15:03:22 +0000 (15:03 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Wed, 19 Oct 2005 15:03:22 +0000 (15:03 +0000)
tests (reported by David Raine on the list, "[Bacula-users] LTO drive -
End Of Volume error").

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

bacula/nb-1.37
bacula/src/stored/block.c

index 9b70707b2e345a46c6b1c70a7cdd1d659b102688..07870a6a71443e9f8cae5f0b7da6185b42657bed 100644 (file)
@@ -5,6 +5,8 @@ General:
 
 Changes to 1.37.*:
 19Oct05
+ - block.c:do_dvd_size_checks: Check we are writing to a dvd before doing tests
+   (reported by David Raine on the list, "[Bacula-users] LTO drive - End Of Volume error").
  - Update bacula-sd.conf.in to use dvd-handler correctly.
  - dvd.c:dvd_write_part: Increase timeout when writing the first part (see the code for
    more details).
index 293a782f826b0ede24221057c74f6fe48f50850e..87c67abe84b8844b48eb618b88424c8a6515e3b1 100644 (file)
@@ -782,11 +782,14 @@ static bool do_dvd_size_checks(DCR *dcr)
    JCR *jcr = dcr->jcr;
    DEV_BLOCK *block = dcr->block;
 
+   /* Don't go further if the device is not a dvd */
+   if (!dev->is_dvd()) {
+      return true;
+   }
+   
    /* Limit maximum part size to value specified by user 
-    * (not applicable to tapes/fifos)   
     */
-   if (!(dev->is_tape() || dev->is_fifo()) && dev->max_part_size > 0 &&
-        (dev->part_size + block->binbuf) >= dev->max_part_size) {
+   if (dev->max_part_size > 0 && ((dev->part_size + block->binbuf) >= dev->max_part_size)) {
       if (dev->part < dev->num_parts) {
          Jmsg3(dcr->jcr, M_FATAL, 0, _("Error while writing, current part number"
                " is less than the total number of parts (%d/%d, device=%s)\n"),