]> git.sur5r.net Git - bacula/bacula/commitdiff
- Fix crash on exit with -t option in FD on 2.6 kernels --
authorKern Sibbald <kern@sibbald.com>
Mon, 18 Oct 2004 15:29:00 +0000 (15:29 +0000)
committerKern Sibbald <kern@sibbald.com>
Mon, 18 Oct 2004 15:29:00 +0000 (15:29 +0000)
  uninitialized thread id variable.
- Add additional SD and FD debug info to detect network hang.
- Fix bnet_strerror() routine not to return stack pointer.
- Put latest update routines in updatedb.

git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1655 91ce42f0-d328-0410-95d8-f526ca767f89

14 files changed:
bacula/LICENSE
bacula/kernstodo
bacula/src/dird/verify.c
bacula/src/filed/backup.c
bacula/src/filed/filed.c
bacula/src/lib/bnet.c
bacula/src/lib/bnet_server.c
bacula/src/lib/bsock.h
bacula/src/stored/append.c
bacula/src/stored/stored.c
bacula/src/version.h
bacula/updatedb/update_mysql_tables_7_to_8
bacula/updatedb/update_postgresql_tables_7_to_8
bacula/updatedb/update_sqlite_tables_7_to_8

index c7bf85e736402155d622508e61a7b08f252f3468..acd46e9114bdd44060bf65151308d433a5af4d71 100644 (file)
@@ -6,24 +6,46 @@ The name Bacula is a registered trademark.
 License:
 For the most part, Bacula is licensed under the GPL version 2 or greater         
 and any code that is Copyright Kern Sibbald and John Walker with the GPL
-indication is so licensed, but with the following two additions:
+indication is so licensed, but with the following four additions:
 
-Linking: Bacula may be linked with any libraries permitted under
+Linking: 
+Bacula may be linked with any libraries permitted under
 the GPL, or with any non-GPLed libraries, including OpenSSL, that
 are required for its proper functioning, providing the source
 code of those non-GPLed libraries is non-proprietary and freely available.
 
-Termination for Patent Action: In addition to the termination
-clause specified in the GPL, this license shall terminate
-automatically and you may no longer exercise any of the rights
-granted to you by this license as of the date you commence an
-action, including a cross-claim or counterclaim, against any
-licensor of GPL software alleging that the software infringes  
-an intellectual property right or a patent. Special dispensation
-from or delay to the execution of this clause may be possible
-by applying directly to the license owner of this software.
-Such a dispensation or delay is valid only in writing and signed
-by the one or more of the license holders.
+Termination for Patent Action: 
+In addition to the termination clause specified in the GPL, this
+license shall terminate automatically and you may no longer
+exercise any of the rights granted to you by this license as of
+the date you commence an action, including a cross-claim or
+counterclaim, against any licensor of GPL software alleging that
+the software infringes an intellectual property right or a
+patent.  Special dispensation from or delay to the execution of
+this clause may be possible by applying directly to the license
+owner of this software.  Such a dispensation or delay is valid
+only in writing and signed by the one or more of the license
+holders.
+
+IP rights:
+Recipient understands that although each Contributor grants the
+licenses to its Contributions set forth herein, no assurances are
+provided by any Contributor that the Program does not infringe
+the patent or other intellectual property rights of any other
+entity.  Each Contributor disclaims any liability to Recipient
+for claims brought by any other entity based on infringement of
+intellectual property rights or otherwise.  As a condition to
+exercising the rights and licenses granted hereunder, each
+Recipient hereby assumes sole responsibility to secure any other
+intellectual property rights needed, if any.  For example, if a
+third party patent license is required to allow Recipient to
+distribute the Program, it is Recipient's responsibility to
+acquire that license before distributing the Program.
+
+Copyrights:
+Each Contributor represents that to its knowledge it has
+sufficient copyright rights in its Contribution, if any, to grant
+the copyright license set forth in this Agreement.
 
 Code falling under the above conditions will be marked as follows:
 
index ef0aea25eb221b67df2ed2e46dd0ead7a0f55b60..0b440a82898a444e5ee51b391d92132a938987d0 100644 (file)
@@ -16,6 +16,10 @@ Version 1.35                Kern (see below)
   
 
 Maybe for 1.35:
+- Implement Files/Bytes,... stats for restore job.
+- Implement Total Bytes Written, ... for restore job.
+- Check dates entered by user for correctness (month/day/... ranges)
+- Compress restore Volume listing by date and first file.
 - Add Pool/Storage override regression test.
 - Add delete JobId to regression.
 - Add bscan to four-concurrent-jobs regression.
@@ -1380,4 +1384,3 @@ Block Position: 0
   scripts to add them.
 - Modify postgresql update script to remove bigint FilenameId           
   reference.
-
index 582f2372315bc4807b1e451dd3d310cb3652cbcf..304f7cafd38ece6867d362e66811bd85c32345ed 100644 (file)
@@ -370,7 +370,7 @@ static void verify_cleanup(JCR *jcr, int TermCode)
 // Dmsg1(100, "Enter verify_cleanup() TermCod=%d\n", TermCode);
    dequeue_messages(jcr);            /* display any queued messages */
 
-   Dmsg3(000, "JobLevel=%c Expected=%u JobFiles=%u\n", jcr->JobLevel,
+   Dmsg3(900, "JobLevel=%c Expected=%u JobFiles=%u\n", jcr->JobLevel,
       jcr->ExpectedFiles, jcr->JobFiles);
    if (jcr->JobLevel == L_VERIFY_VOLUME_TO_CATALOG &&
        jcr->ExpectedFiles != jcr->JobFiles) {
index 209f95102e28315c77d93be814b44f90219a5148..6492cc31c9300eed4370d3f58c20c79816358feb 100644 (file)
@@ -468,11 +468,11 @@ static int save_file(FF_PKT *ff_pkt, void *vjcr)
            sd->msg = wbuf;           /* set correct write buffer */
            if (!bnet_send(sd)) {
               berrno be;
+               Jmsg2(jcr, M_FATAL, 0, _("Network send error %d to SD. ERR=%s\n"),
+                    sd->msglen, bnet_strerror(sd));
               sd->msg = msgsave;     /* restore bnet buffer */
               sd->msglen = 0;
               bclose(&ff_pkt->bfd);
-               Jmsg1(jcr, M_FATAL, 0, _("Network send error to SD. ERR=%s\n"),
-                    bnet_strerror(sd));
               return 0;
            }
         }
index 1223a9c5a07c90be9c3fb8cce3f190a2b31f1888..7e0b61effc1087cbe83549948c0bd5d951009314 100644 (file)
@@ -167,6 +167,7 @@ int main (int argc, char *argv[])
       usage();
    }
 
+   server_tid = pthread_self();
    if (!no_signals) {
       init_signals(terminate_filed);
    } else {
index df41939ec693b1daeabe700e8e25ed6f2da3c481..7f5cdbb4405aeb594afcaa8b83f1b0be8d9ae6a8 100644 (file)
@@ -784,7 +784,11 @@ Retrying ...\n", name, host, port, be.strerror());
 const char *bnet_strerror(BSOCK * bsock)
 {
    berrno be;
-   return be.strerror(bsock->b_errno);
+   if (bsock->errmsg == NULL) {
+      bsock->errmsg = get_pool_memory(PM_MESSAGE);
+   }
+   pm_strcpy(bsock->errmsg, be.strerror(bsock->b_errno));
+   return bsock->errmsg;
 }
 
 /*
index b97ba237e3451da5d03524d6be76af5bf9d4e5bd..8d8cfbb15e3e04768a04403675f183738f60a28a 100644 (file)
@@ -52,7 +52,9 @@ static bool quit = false;
 void bnet_stop_thread_server(pthread_t tid)
 {
    quit = true;
-   pthread_kill(tid, TIMEOUT_SIGNAL);
+   if (!pthread_equal(tid, pthread_self())) {
+      pthread_kill(tid, TIMEOUT_SIGNAL);
+   }
 }
 
 /* 
index 0c4bd4d2314cb09c829bb9bc6a1a25b087663c10..71af6a700cc66661c54dc8399d4ae01e1ece80c2 100644 (file)
@@ -50,7 +50,7 @@ struct BSOCK {
    POOLMEM *msg;                      /* message pool buffer */
    char *who;                         /* Name of daemon to which we are talking */
    char *host;                        /* Host name/IP */
-   POOLMEM *errmsg;                   /* edited error message (to be implemented) */
+   POOLMEM *errmsg;                   /* edited error message */
    RES *res;                          /* Resource to which we are connected */
    BSOCK *next;                       /* next BSOCK if duped */
    FILE *spool_fd;                    /* spooling file */
index f160778eb73761ae2f384554bd8696f2fc77bf3e..2b5cbc5bf5e84fa9e3a6e681f3321dd945ced33d 100644 (file)
@@ -231,8 +231,11 @@ bool do_append_data(JCR *jcr)
               jcr->dir_bsock->spool = false;
            }
         }
+         Dmsg0(350, "Enter bnet_get\n");
       }
+      Dmsg1(350, "End read loop with FD. Stat=%d\n", n);
       if (is_bnet_error(ds)) {
+         Dmsg1(350, "Network read error from FD. ERR=%s\n", bnet_strerror(ds));
          Jmsg1(jcr, M_FATAL, 0, _("Network error on data channel. ERR=%s\n"),
               bnet_strerror(ds));
         ok = false;
index 4a45fb86c75a262ab4483592799d869d13ddff76..27fe7618cc511962ab615a6482da027c0a61e4ed 100644 (file)
@@ -354,14 +354,14 @@ void *device_allocation(void *arg)
 /* Clean up and then exit */
 void terminate_stored(int sig)
 {
-   static int in_here = FALSE;
+   static bool in_here = false;
    DEVRES *device;
    JCR *jcr;
 
    if (in_here) {                    /* prevent loops */
       exit(1);
    }
-   in_here = TRUE;
+   in_here = true;
 
    if (sig == SIGTERM) {             /* normal shutdown request? */
       /*
@@ -380,8 +380,8 @@ void terminate_stored(int sig)
         set_jcr_job_status(jcr, JS_Canceled);
         fd = jcr->file_bsock;  
         if (fd) {
-           fd->timed_out = TRUE;
-            Dmsg1(100, "killing JobId=%d\n", jcr->JobId);
+           fd->timed_out = true;
+            Dmsg1(100, "term_stored killing JobId=%d\n", jcr->JobId);
            pthread_kill(jcr->my_thread_id, TIMEOUT_SIGNAL);
            if (jcr->device && jcr->device->dev && jcr->device->dev->dev_blocked) {
               pthread_cond_signal(&jcr->device->dev->wait_next_vol);
index 1f4dc4140729f5b55aaae80a5d98be878e06ef15..921434b8f387796b60a4fef5554f87d2fe9b90a4 100644 (file)
@@ -1,8 +1,8 @@
 /* */
 #undef  VERSION
 #define VERSION "1.35.9"
-#define BDATE   "16 October 2004"
-#define LSMDATE "16Oct04"
+#define BDATE   "18 October 2004"
+#define LSMDATE "18Oct04"
 
 /* Debug flags */
 #undef  DEBUG
index 58a50eff9f54a1d94237604b824059e8aeaef8cf..8e41e871f5ba648d2b3c33680f7d7cb76b3266ff 100755 (executable)
@@ -15,17 +15,13 @@ USE bacula;
 ALTER TABLE Media ADD COLUMN EndFile INTEGER UNSIGNED NOT NULL DEFAULT 0;
 ALTER TABLE Media ADD COLUMN EndBlock INTEGER UNSIGNED NOT NULL DEFAULT 0;
 
+ALTER TABLE File ADD INDEX (JobId, PathId, FilenameId);
+
 UPDATE Filename SET Name='' WHERE Name=' ';
 
 DELETE FROM Version;
 INSERT INTO Version (VersionId) VALUES (8);
 
-CREATE TABLE CDImages (
-   MediaId INTEGER UNSIGNED NOT NULL,
-   LastBurn DATETIME NOT NULL,
-   PRIMARY KEY (MediaId)
-   );
-
 END-OF-DATA
 then
    echo "Update of Bacula MySQL tables succeeded."
index b2dd8e60a2fa1ae21656301ee99391f06af52048..84b2f0e3b398d4b3d9ea8603a79a9643a0668ad7 100755 (executable)
@@ -12,20 +12,24 @@ bindir=/home/kern/bacula/depkgs/sqlite
 if $bindir/psql $* -f - <<END-OF-DATA
 \c bacula
 
-ALTER TABLE Media ADD COLUMN EndFile integer not null default 0;
-ALTER TABLE Media ADD COLUMN EndBlock integer not null default 0;
+ALTER TABLE media ADD COLUMN EndFile integer;
+UPDATE media SET EndFile=0;
+ALTER TABLE media ALTER COLUMN EndFile SET NOT NULL;
+ALTER TABLE media ADD COLUMN EndBlock integer;
+UPDATE media SET EndBlock=0;
+ALTER TABLE media ALTER COLUMN EndBlock SET NOT NULL;
 
 UPDATE Filename SET Name='' WHERE Name=' ';
 
+ALTER TABLE file ALTER COLUMN filenameid SET integer;
+
 DELETE FROM Version;
 INSERT INTO Version (VersionId) VALUES (8);
 
-create table CDImages 
-(
-   MediaId integer not null,
-   LastBurn timestamp without time zone not null,
-   primary key (MediaId)
-);
+create index file_jobid_idx on file (jobid);
+create index file_pathid_idx on file(pathid);
+create index file_filenameid_idx on file(filenameid);
+create index file_jpfid_idx on file (jobid, pathid, filenameid);
 
 END-OF-DATA
 then
index d7e1f83f9d5626a39fa26f629a8ff06e5737c03b..18823cc4abf4752fb75e8a3c714493f29edb21f4 100755 (executable)
@@ -109,11 +109,7 @@ INSERT INTO Media (
 
 DROP TABLE Media_backup;
 
-CREATE TABLE CDImages (
-   MediaId INTEGER UNSIGNED NOT NULL,
-   LastBurn DATETIME NOT NULL,
-   PRIMARY KEY (MediaId)
-   );
+CREATE INDEX inx9 ON File (JobId, PathId, FileNameId);
 
 COMMIT;