From 9f6e090f4c0995a443afc6c1efa0bac5db146a72 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Thu, 29 Aug 2002 13:02:17 +0000 Subject: [PATCH] Additional error checking git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@128 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/kernstodo | 2 ++ bacula/src/stored/label.c | 8 +++++++- bacula/src/stored/read.c | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/bacula/kernstodo b/bacula/kernstodo index 3e76f18b85..45d0d40d57 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -28,6 +28,8 @@ From Chuck: --sd.conf password does not match dir.conf storage password ======= +- Correct Warning: Volume name mismatch. Wanted test2 got test1 + when reading a tape and want the next one. - Create all pools when Director starts - Implement autochanger for restore. ARRRGGG! I forgot! - Make BSR accept count (total files to be restored). diff --git a/bacula/src/stored/label.c b/bacula/src/stored/label.c index 14c15b7f09..1570709b0a 100644 --- a/bacula/src/stored/label.c +++ b/bacula/src/stored/label.c @@ -489,6 +489,7 @@ int write_session_label(JCR *jcr, DEV_BLOCK *block, int label) * read the next block). */ if (!can_write_record_to_block(block, rec)) { + Dmsg0(100, "Cannot write session label to block.\n"); if (!write_block_to_device(jcr, dev, block)) { Dmsg0(90, "Got session label write_block_to_dev error.\n"); Jmsg(jcr, M_FATAL, 0, _("Error writing Session label to %s: %s\n"), @@ -497,7 +498,12 @@ int write_session_label(JCR *jcr, DEV_BLOCK *block, int label) return 0; } } - write_record_to_block(block, rec); + if (!write_record_to_block(block, rec)) { + Jmsg(jcr, M_FATAL, 0, _("Error writing Session label to %s: %s\n"), + dev_vol_name(dev), strerror(errno)); + free_record(rec); + return 0; + } Dmsg6(20, "Write sesson_label record JobId=%d FI=%s SessId=%d Strm=%s len=%d\n\ remainder=%d\n", jcr->JobId, diff --git a/bacula/src/stored/read.c b/bacula/src/stored/read.c index b4037e813d..52cc6ad58e 100644 --- a/bacula/src/stored/read.c +++ b/bacula/src/stored/read.c @@ -202,7 +202,7 @@ int do_read_data(JCR *jcr) ds->msglen = rec->data_len; Dmsg1(40, ">filed: send %d bytes data.\n", ds->msglen); if (!bnet_send(ds)) { - Dmsg1(000, "Error sending to FD. ERR=%s\n", bnet_strerror(ds)); + Pmsg1(000, "Error sending to FD. ERR=%s\n", bnet_strerror(ds)); Dmsg1(100, "Hdr=%s\n", hdr); Dmsg1(100, "data=%s\n", ds->msg); Jmsg1(jcr, M_FATAL, 0, _("Error sending to File daemon. ERR=%s\n"), -- 2.39.5