From 6d936051f2d614570d7baf48c46f102e49e47cc8 Mon Sep 17 00:00:00 2001 From: Kern Sibbald Date: Tue, 20 May 2008 15:42:58 +0000 Subject: [PATCH] kes Remove double quotes from ChangeLog and ReleaseNotes kes Remove StorageId test when pruning and recycling (Eric's changes). kes Remove old form of locking when getting volumes -- causes deadlock. kes Fix buffer overruns detected by Coverity. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/branches/Branch-2.2@6999 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/ChangeLog | 6 +++--- bacula/ReleaseNotes | 4 ++-- bacula/src/dird/autoprune.c | 12 ++---------- bacula/src/dird/recycle.c | 11 ++--------- bacula/src/stored/askdir.c | 2 -- bacula/src/version.h | 4 ++-- bacula/technotes-2.1 | 5 +++++ 7 files changed, 16 insertions(+), 28 deletions(-) diff --git a/bacula/ChangeLog b/bacula/ChangeLog index 57bc9a52a9..b34a8d9a0a 100644 --- a/bacula/ChangeLog +++ b/bacula/ChangeLog @@ -217,7 +217,7 @@ kes Fix existing switch drive SD code to call autochanger to release kes Apply big backport of current SVN SD code that corrects a number of race conditions. This is a first step in fixing bug #1018. 29Dec07 -ebl Fixes bug #1028 where "Selection Type" option was not usable +ebl Fixes bug #1028 where 'Selection Type' option was not usable with JobDefs. @@ -436,10 +436,10 @@ kes Note, you need GTK >= 2.10 to be able to link the Tray Monitor program. kes Move patches into patches directory. 11Sep07 -ebl Fix bug #946 about "bacula-dir -t" which doesn't works +ebl Fix bug #946 about 'bacula-dir -t' which doesn't works as expected. 09Sep07 -ebl Using "m" in bconsole will show messages like before, +ebl Using 'm' in bconsole will show messages like before, and not memory usage. Release Version 2.2.3 diff --git a/bacula/ReleaseNotes b/bacula/ReleaseNotes index 8a5d205122..acbf0e5c26 100644 --- a/bacula/ReleaseNotes +++ b/bacula/ReleaseNotes @@ -200,9 +200,9 @@ Version 2.2.4 is a minor bug fix release to version 2.2.3 by skipping |. Fixes bug #936. - Implement patch supplied by Landon to fix bug #944 where using TLS with bconsole uses 99+% of the CPU. -- Fix bug #946 about "bacula-dir -t" which doesn't works +- Fix bug #946 about 'bacula-dir -t' which doesn't works as expected. -- Using "m" in bconsole will show messages as in prior versions +- Using 'm' in bconsole will show messages as in prior versions and not memory usage. - Note, you need GTK >= 2.10 to be able to link the Tray Monitor diff --git a/bacula/src/dird/autoprune.c b/bacula/src/dird/autoprune.c index df4cb5542d..2b8e8cb91f 100644 --- a/bacula/src/dird/autoprune.c +++ b/bacula/src/dird/autoprune.c @@ -138,18 +138,10 @@ bool prune_volumes(JCR *jcr, bool InChanger, MEDIA_DBR *mr) * RecyclePoolId is the current pool or the scratch pool */ const char *select = "SELECT DISTINCT MediaId,LastWritten FROM Media WHERE " - "(PoolId=%s OR RecyclePoolId IN (%s)) AND MediaType='%s' %s" + "(PoolId=%s OR RecyclePoolId IN (%s)) AND MediaType='%s' " "ORDER BY LastWritten ASC,MediaId"; - if (InChanger) { - char changer[100]; - /* Ensure it is in this autochanger */ - bsnprintf(changer, sizeof(changer), "AND InChanger=1 AND StorageId=%s ", - edit_int64(mr->StorageId, ed3)); - Mmsg(query, select, ed1, ed2, mr->MediaType, changer); - } else { - Mmsg(query, select, ed1, ed2, mr->MediaType, ""); - } + Mmsg(query, select, ed1, ed2, mr->MediaType); Dmsg1(050, "query=%s\n", query.c_str()); if (!db_get_query_dbids(ua->jcr, ua->db, query, ids)) { diff --git a/bacula/src/dird/recycle.c b/bacula/src/dird/recycle.c index d960643db6..fdabb4d600 100644 --- a/bacula/src/dird/recycle.c +++ b/bacula/src/dird/recycle.c @@ -83,19 +83,12 @@ bool recycle_oldest_purged_volume(JCR *jcr, bool InChanger, MEDIA_DBR *mr) const char *select = "SELECT MediaId,LastWritten FROM Media " "WHERE PoolId=%s AND Recycle=1 AND VolStatus='Purged' " - "AND Enabled=1 AND MediaType='%s' %s" + "AND Enabled=1 AND MediaType='%s' " "ORDER BY LastWritten ASC,MediaId LIMIT 1"; Dmsg0(100, "Enter recycle_oldest_purged_volume\n"); oldest.MediaId = 0; - if (InChanger) { - char changer[100]; - bsnprintf(changer, sizeof(changer), "AND InChanger=1 AND StorageId=%s ", - edit_int64(mr->StorageId, ed1)); - Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType, changer); - } else { - Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType, ""); - } + Mmsg(query, select, edit_int64(mr->PoolId, ed1), mr->MediaType); if (!db_sql_query(jcr->db, query, oldest_handler, (void *)&oldest)) { Jmsg(jcr, M_ERROR, 0, "%s", db_strerror(jcr->db)); diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index d67cd328eb..e71d74c76b 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -491,9 +491,7 @@ bool dir_ask_sysop_to_create_appendable_volume(DCR *dcr) Jmsg(jcr, M_INFO, 0, "%s", dev->errmsg); return false; } - dev->dlock(); got_vol = dir_find_next_appendable_volume(dcr); /* get suggested volume */ - dev->dunlock(); if (got_vol) { return true; } else { diff --git a/bacula/src/version.h b/bacula/src/version.h index 49260476de..d40560bdd0 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -4,8 +4,8 @@ #undef VERSION #define VERSION "2.2.10-b3" -#define BDATE "12 May 2008" -#define LSMDATE "12May08" +#define BDATE "20 May 2008" +#define LSMDATE "20May08" #define PROG_COPYRIGHT "Copyright (C) %d-2008 Free Software Foundation Europe e.V.\n" #define BYEAR "2008" /* year for copyright messages in progs */ diff --git a/bacula/technotes-2.1 b/bacula/technotes-2.1 index 9ec0d00812..ff1cf72bcd 100644 --- a/bacula/technotes-2.1 +++ b/bacula/technotes-2.1 @@ -1,6 +1,11 @@ Technical notes on version 2.2 General: + +20May08 +kes Remove double quotes from ChangeLog and ReleaseNotes +kes Remove StorageId test when pruning and recycling (Eric's changes). +kes Remove old form of locking when getting volumes -- causes deadlock. 17May08 kes Fix buffer overruns detected by Coverity. -- 2.39.2