]> git.sur5r.net Git - bacula/bacula/commitdiff
- make enable_vss persistent per backup job (cache it)
authorThorsten Engel <thorsten.engel@matrix-computer.com>
Mon, 24 Apr 2006 09:24:34 +0000 (09:24 +0000)
committerThorsten Engel <thorsten.engel@matrix-computer.com>
Mon, 24 Apr 2006 09:24:34 +0000 (09:24 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@2962 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/filed/job.c

index 6c2185702951e98bff5be889be21dde8af0abeaa..4e6d9b3fdae40013b903b9bb9f388a9fecce6ea0 100644 (file)
@@ -1190,8 +1190,14 @@ static int backup_cmd(JCR *jcr)
    int SDJobStatus;
    char ed1[50], ed2[50];
 
+   // capture state here, if client is backed up by multiple directors
+   // and one enables vss and the other does not then enable_vss can change
+   // between here and where its evaluated after the job completes.
+   BOOL bDoVSS = FALSE;
+
 #ifdef WIN32_VSS
-   if (g_pVSSClient && enable_vss)
+   bDoVSS = g_pVSSClient && enable_vss;
+   if (bDoVSS)
       /* Run only one at a time */
       P(vss_mutex);
 #endif
@@ -1246,7 +1252,7 @@ static int backup_cmd(JCR *jcr)
 
 #ifdef WIN32_VSS
    /* START VSS ON WIN 32 */
-   if (g_pVSSClient && enable_vss) {      
+   if (bDoVSS) {      
       if (g_pVSSClient->InitializeForBackup()) {   
         /* tell vss which drives to snapshot */   
         char szWinDriveLetters[27];   
@@ -1338,7 +1344,7 @@ cleanup:
 #ifdef WIN32_VSS
    /* STOP VSS ON WIN 32 */
    /* tell vss to close the backup session */
-   if (g_pVSSClient && enable_vss) {
+   if (bDoVSS) {
       if (g_pVSSClient->CloseBackup()) {             
          /* inform user about writer states */
          for (size_t i=0; i<g_pVSSClient->GetWriterCount(); i++) {