]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/dird/catreq.c
This commit was manufactured by cvs2svn to create tag
[bacula/bacula] / bacula / src / dird / catreq.c
index 05f7f1e8841f92caae7fc5c5e52a25a9423f3940..91feaff4bb0f000b8fd699249e9248bea55dab6f 100644 (file)
@@ -145,8 +145,10 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
 
               /* 
                * Now try recycling if necessary
+               *   reason set non-NULL if we cannot use it
+               *   We also check for Volume being expired.
                */
-              is_volume_valid_or_recyclable(jcr, &mr, &reason);
+              check_if_volume_valid_or_recyclable(jcr, &mr, &reason);
            }
         }
         if (reason == NULL) {
@@ -164,7 +166,8 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
             Dmsg2(100, "Vol Info for %s: %s", jcr->Job, bs->msg);
         } else { 
            /* Not suitable volume */
-            bnet_fsend(bs, "1998 Volume \"%s\" %s.\n", mr.VolumeName, reason);
+            bnet_fsend(bs, "1998 Volume \"%s\" status is %s, %s.\n", mr.VolumeName, 
+              mr.VolStatus, reason);
         }
 
       } else {
@@ -216,14 +219,6 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
       bstrncpy(mr.VolStatus, sdmr.VolStatus, sizeof(mr.VolStatus));
       mr.Slot = sdmr.Slot;
 
-      /*     
-       * Apply expiration periods and limits, if not a label request,
-       *   and ignore status because if !label we won't use it.
-       */
-      if (!label) {
-        has_volume_expired(jcr, &mr);
-      }
-
       Dmsg2(200, "db_update_media_record. Stat=%s Vol=%s\n", mr.VolStatus, mr.VolumeName);
       /*
        * Write the modified record to the DB
@@ -237,6 +232,7 @@ void catalog_request(JCR *jcr, BSOCK *bs, char *msg)
          bnet_fsend(bs, "1992 Update Media error\n");
          Dmsg0(190, "send error\n");
       }
+      has_volume_expired(jcr, &mr);   /* if expired, change Media record */
       db_unlock(jcr->db);
 
    /*