From: Kern Sibbald Date: Sat, 22 Mar 2008 09:34:20 +0000 (+0000) Subject: Fix bug pointed out by Peter Much that causes the StorageId to X-Git-Tag: Release-2.2.9-b7~48 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=af555d2a66a4cdd8b9d44f767f639ecdcba4257e;p=bacula%2Fbacula 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). git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6663 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index fe4eacc94a..dcc58a48a5 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -285,7 +285,12 @@ void catalog_request(JCR *jcr, BSOCK *bs) 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; } diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index ea625f699f..6e7a22eb01 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,10 @@ Technical notes on version 2.2 General: +22Mar08 +kes 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). 21Mar08 kes Implement autostart scripts for Debian 20Mar08