From: <ke...@us...> - 2008-03-22 09:35:28
|
Revision: 6664 http://bacula.svn.sourceforge.net/bacula/?rev=6664&view=rev Author: kerns Date: 2008-03-22 02:34:45 -0700 (Sat, 22 Mar 2008) Log Message: ----------- Fix bug pointed out by Peter Much that causes the StorageId to be updated when reading a tape (during migration, it could have been incorrectly set to the write StorageId). Modified Paths: -------------- trunk/bacula/src/dird/catreq.c Property Changed: ---------------- trunk/bacula/platforms/debian/ Property changes on: trunk/bacula/platforms/debian ___________________________________________________________________ Name: svn:ignore + bacula-sd bacula-fd bacula-dir Makefile Modified: trunk/bacula/src/dird/catreq.c =================================================================== --- trunk/bacula/src/dird/catreq.c 2008-03-22 09:34:20 UTC (rev 6663) +++ trunk/bacula/src/dird/catreq.c 2008-03-22 09:34:45 UTC (rev 6664) @@ -267,8 +267,10 @@ } } Dmsg2(400, "Update media: BefVolJobs=%u After=%u\n", mr.VolJobs, sdmr.VolJobs); - /* Check if the volume has been written by the job, - * and update the LastWritten field if needed */ + /* + * Check if the volume has been written by the job, + * and update the LastWritten field if needed. + */ if (mr.VolBlocks != sdmr.VolBlocks && VolLastWritten != 0) { mr.LastWritten = VolLastWritten; } @@ -286,7 +288,12 @@ mr.VolWriteTime = sdmr.VolWriteTime; mr.VolParts = sdmr.VolParts; bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus)); - if (jcr->wstore && jcr->wstore->StorageId) { + /* + * Update to point to the last device used to write the Volume. + * However, do so only if we are writing the tape, i.e. + * the number of VolBlocks has increased. + */ + if (jcr->wstore && jcr->wstore->StorageId && mr.VolBlocks != sdmr.VolBlocks) { mr.StorageId = jcr->wstore->StorageId; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |