From: Kern Sibbald Date: Sat, 9 Jun 2012 09:33:23 +0000 (+0200) Subject: Fail job that attempts to read from closed device -- reported in bug 1885 but not... X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=892711be6f9b60d250aea4db3ec76c627b6f4753;p=bacula%2Fbacula Fail job that attempts to read from closed device -- reported in bug 1885 but not fixed --- diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index ddc7b16f35..72a9d82d95 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -951,7 +951,13 @@ bool DCR::read_block_from_dev(bool check_block_numbers) Dmsg1(250, "Full read in read_block_from_device() len=%d\n", block->buf_len); -// ASSERT(dev->is_open()); + if (!dev->is_open()) { + Mmsg4(dev->errmsg, _("Attempt to read closed device: fd=%d at file:blk %u:%u on device %s\n"), + dev->fd(), dev->file, dev->block_num, dev->print_name()); + Jmsg(dcr->jcr, M_FATAL, 0, "%s", dev->errmsg); + block->read_len = 0; + return false; + } reread: if (looping > 1) {