From: Nicolas Boichat Date: Wed, 19 Oct 2005 15:03:22 +0000 (+0000) Subject: block.c:do_dvd_size_checks: Check we are writing to a dvd before doing X-Git-Tag: Release-1.38.0~46 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=29aeccbf02a3bf936f396115d6a6e3e1bdb62419;p=bacula%2Fbacula 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"). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2469 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/nb-1.37 b/bacula/nb-1.37 index 9b70707b2e..07870a6a71 100644 --- a/bacula/nb-1.37 +++ b/bacula/nb-1.37 @@ -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). diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index 293a782f82..87c67abe84 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -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"),