From: Kern Sibbald Date: Tue, 14 Jan 2003 22:33:44 +0000 (+0000) Subject: Update files on tape X-Git-Tag: Release-1.29~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c0c8db042b88110fcc349ad9d90d99954531314e;p=bacula%2Fbacula Update files on tape git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@292 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index c9b16f152e..dce2e54c69 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -250,7 +250,7 @@ int release_device(JCR *jcr, DEVICE *dev) Dmsg0(100, "dir_create_jobmedia_record. Release\n"); dir_create_jobmedia_record(jcr); weof_dev(dev, 1); - dev->VolCatInfo.VolCatFiles++; /* increment number of files */ + dev->VolCatInfo.VolCatFiles = dev->file; /* set number of files */ dev->VolCatInfo.VolCatJobs++; /* increment number of jobs */ /* Note! do volume update before close, which zaps VolCatInfo */ Dmsg0(200, "dir_update_vol_info. Release0\n"); @@ -266,6 +266,7 @@ int release_device(JCR *jcr, DEVICE *dev) Dmsg0(100, "dir_create_jobmedia_record. Release\n"); dir_create_jobmedia_record(jcr); Dmsg0(200, "dir_update_vol_info. Release1\n"); + dev->VolCatInfo.VolCatFiles = dev->file; /* set number of files */ dev->VolCatInfo.VolCatJobs++; /* increment number of jobs */ dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */ } diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 9402c18de7..4b1091abe2 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -313,13 +313,13 @@ mount_error: * Check if we are positioned on the tape at the same place * that the database says we should be. */ - if (dev->VolCatInfo.VolCatFiles == dev_file(dev) + 1) { + if (dev->VolCatInfo.VolCatFiles == dev_file(dev)) { Jmsg(jcr, M_INFO, 0, _("Ready to append to end of Volume at file=%d.\n"), dev_file(dev)); } else { Jmsg(jcr, M_ERROR, 0, _("I canot write on this volume because:\n\ The number of files mismatch! Volume=%d Catalog=%d\n"), - dev_file(dev)+1, dev->VolCatInfo.VolCatFiles); + dev_file(dev), dev->VolCatInfo.VolCatFiles); strcpy(dev->VolCatInfo.VolCatStatus, "Error"); Dmsg0(200, "dir_update_vol_info. Set Error.\n"); dir_update_volume_info(jcr, &dev->VolCatInfo, 0);