From: Kern Sibbald Date: Wed, 4 Apr 2007 18:34:15 +0000 (+0000) Subject: Another tweak for bug 801 X-Git-Tag: Release-7.0.0~6618 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=603d7ac671f8f5ec1f2f0cf0782ca23664b1393d;p=bacula%2Fbacula Another tweak for bug 801 git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@4509 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/stored/reserve.c b/bacula/src/stored/reserve.c index 4b459993f9..79d299dd29 100644 --- a/bacula/src/stored/reserve.c +++ b/bacula/src/stored/reserve.c @@ -148,7 +148,11 @@ again: foreach_dlist(vol, vol_list) { if (vol && vol->dev == dcr->dev) { vol_list->remove(vol); - if (vol->vol_name) { + /* + * Make sure we don't remove the current volume we are inserting + * because it was probably inserted by another job. + */ + if (vol->vol_name && strcmp(vol->vol_name, VolumeName) != 0) { Dmsg1(100, "new_vol free vol=%s\n", vol->vol_name); free(vol->vol_name); } @@ -276,8 +280,8 @@ void free_unused_volume(DCR *dcr) /* * Releease this volume, but only if we inserted it (same dcr) and * it is not attached to a device or the Volume in the device is - * different. - * I wonder if this is right, kes ... + * different. Requiring a different name for the Volume in the + * device ensures that we don't free a volume in use. */ if (vol->dcr == dcr && (vol->dev == NULL || strcmp(vol->vol_name, vol->dev->VolHdr.VolumeName) != 0)) {