From: Kern Sibbald Date: Sun, 12 Jan 2003 20:32:24 +0000 (+0000) Subject: Fix UseDuration (hopefully) X-Git-Tag: Release-1.29~39 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=9bddbb997b2383563c9185a828569d77140b803d;p=bacula%2Fbacula Fix UseDuration (hopefully) git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@281 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/kernstodo b/bacula/kernstodo index f40b28094e..778e24907e 100644 --- a/bacula/kernstodo +++ b/bacula/kernstodo @@ -1,5 +1,5 @@ Kern's ToDo List - 08 January 2003 + 11 January 2003 Documentation to do: (a little bit at a time) - Document running a test version. @@ -16,6 +16,16 @@ Testing to do: (painful) - test and fix < code and | code. For 1.29 release: +- Why is catreq.c:111 Find vol called twice for a job? +- Why is FirstWritten = -1 after label? +- Add include list to end of chain in findlib +- Fix cancel in find_one -- need jcr. +- Write SetJobStatus() function so cancel status not lost. +- Find out why Full saves run slower and slower (hashing?) +- Test size of hash table needed in find_one using testfind. +- Make 1.28c release +- Rewrite find_one.c to use only pool_memory instead of + alloca and malloc. - Make sure btraceback goes into /sbin not sysconf directory. - Get correct error status from run_program or open_bpipe(). - Figure out how to allow multiple simultaneous file Volumes on diff --git a/bacula/src/cats/sql_find.c b/bacula/src/cats/sql_find.c index 7f333f4f48..c8ebb262ee 100644 --- a/bacula/src/cats/sql_find.c +++ b/bacula/src/cats/sql_find.c @@ -206,7 +206,8 @@ db_find_next_volume(B_DB *mdb, int item, MEDIA_DBR *mr) Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,\ VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,Recycle,Slot,\ -FirstWritten FROM Media WHERE PoolId=%d AND MediaType='%s' AND VolStatus='%s' \ +FirstWritten,LastWritten \ +FROM Media WHERE PoolId=%d AND MediaType='%s' AND VolStatus='%s' \ ORDER BY MediaId", mr->PoolId, mr->MediaType, mr->VolStatus); if (!QUERY_DB(mdb, mdb->cmd)) { @@ -253,6 +254,9 @@ ORDER BY MediaId", mr->PoolId, mr->MediaType, mr->VolStatus); mr->Recycle = str_to_int64(row[15]); mr->Slot = str_to_int64(row[16]); bstrncpy(mr->cFirstWritten, row[17]!=NULL?row[17]:"", sizeof(mr->cFirstWritten)); + mr->FirstWritten = (time_t)str_to_utime(mr->cFirstWritten); + bstrncpy(mr->cLastWritten, row[18]!=NULL?row[18]:"", sizeof(mr->cLastWritten)); + mr->LastWritten = (time_t)str_to_utime(mr->cLastWritten); sql_free_result(mdb); diff --git a/bacula/src/cats/sql_get.c b/bacula/src/cats/sql_get.c index 197adfc372..947e980185 100644 --- a/bacula/src/cats/sql_get.c +++ b/bacula/src/cats/sql_get.c @@ -795,13 +795,13 @@ int db_get_media_record(B_DB *mdb, MEDIA_DBR *mr) Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,\ MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,\ -Recycle,Slot, FirstWritten \ +Recycle,Slot,FirstWritten,LastWritten \ FROM Media WHERE MediaId=%d", mr->MediaId); } else { /* find by name */ Mmsg(&mdb->cmd, "SELECT MediaId,VolumeName,VolJobs,VolFiles,VolBlocks,\ VolBytes,VolMounts,VolErrors,VolWrites,MaxVolBytes,VolCapacityBytes,\ MediaType,VolStatus,PoolId,VolRetention,VolUseDuration,MaxVolJobs,MaxVolFiles,\ -Recycle,Slot,FirstWritten \ +Recycle,Slot,FirstWritten,LastWritten \ FROM Media WHERE VolumeName='%s'", mr->VolumeName); } @@ -839,6 +839,9 @@ FROM Media WHERE VolumeName='%s'", mr->VolumeName); mr->Recycle = str_to_int64(row[18]); mr->Slot = str_to_int64(row[19]); bstrncpy(mr->cFirstWritten, row[20]!=NULL?row[20]:"", sizeof(mr->cFirstWritten)); + mr->FirstWritten = (time_t)str_to_utime(mr->cFirstWritten); + bstrncpy(mr->cLastWritten, row[21]!=NULL?row[21]:"", sizeof(mr->cLastWritten)); + mr->LastWritten = (time_t)str_to_utime(mr->cLastWritten); stat = mr->MediaId; } } else { diff --git a/bacula/src/cats/sql_update.c b/bacula/src/cats/sql_update.c index cc76d06751..1f2ca28f21 100644 --- a/bacula/src/cats/sql_update.c +++ b/bacula/src/cats/sql_update.c @@ -183,7 +183,7 @@ db_update_pool_record(B_DB *mdb, POOL_DBR *pr) int db_update_media_record(B_DB *mdb, MEDIA_DBR *mr) { - char dt[MAX_TIME_LENGTH]; + char dt[MAX_TIME_LENGTH], dtF[MAX_TIME_LENGTH]; time_t ttime; struct tm tm; int stat; @@ -195,10 +195,13 @@ db_update_media_record(B_DB *mdb, MEDIA_DBR *mr) Dmsg1(100, "update_media: FirstWritten=%d\n", mr->FirstWritten); db_lock(mdb); - if (mr->VolMounts == 1 && mr->VolBlocks==1 && mr->VolWrites==1) { + if (mr->VolJobs == 1) { Dmsg1(400, "Set FirstWritten Vol=%s\n", mr->VolumeName); + ttime = mr->FirstWritten; + localtime_r(&ttime, &tm); + strftime(dtF, sizeof(dtF), "%Y-%m-%d %T", &tm); Mmsg(&mdb->cmd, "UPDATE Media SET FirstWritten='%s'\ - WHERE VolumeName='%s'", dt, mr->VolumeName); + WHERE VolumeName='%s'", dtF, mr->VolumeName); stat = UPDATE_DB(mdb, mdb->cmd); Dmsg1(400, "Firstwritten stat=%d\n", stat); } diff --git a/bacula/src/dird/catreq.c b/bacula/src/dird/catreq.c index bdb8542334..e68ef0a259 100644 --- a/bacula/src/dird/catreq.c +++ b/bacula/src/dird/catreq.c @@ -108,13 +108,14 @@ next_volume: } } /* Check if use duration has expired */ - if (ok && mr.VolUseDuration > 0 && - strcmp(mr.VolStatus, "Recycle") != 0) { + Dmsg2(200, "VolJobs=%d FirstWritten=%d\n", mr.VolJobs, mr.FirstWritten); + if (ok && mr.VolJobs > 0 && mr.VolUseDuration > 0 && + strcmp(mr.VolStatus, "Recycle") != 0) { utime_t now = time(NULL); - utime_t start = str_to_utime(mr.cFirstWritten); - if (start > 0 && mr.VolUseDuration <= (now - start)) { + if (mr.VolUseDuration <= (now - mr.FirstWritten)) { Dmsg4(100, "Duration=%d now=%d start=%d now-start=%d\n", - (int)jcr->pool->VolUseDuration, (int)now, (int)start, (int)(now-start)); + (int)jcr->pool->VolUseDuration, (int)now, (int)mr.FirstWritten, + (int)(now-mr.FirstWritten)); Jmsg(jcr, M_INFO, 0, _("Max configured use duration exceeded. " "Marking Volume \"%s\" as Used.\n"), mr.VolumeName); strcpy(mr.VolStatus, "Used"); /* yes, mark as used */ @@ -145,6 +146,7 @@ next_volume: edit_uint64(mr.MaxVolBytes, ed2), edit_uint64(mr.VolCapacityBytes, ed3), mr.VolStatus, mr.Slot, mr.MaxVolJobs, mr.MaxVolFiles); + Dmsg1(200, "Find media: %s", bs->msg); } else { bnet_fsend(bs, "1999 No Media\n"); } @@ -191,8 +193,7 @@ next_volume: edit_uint64(mr.MaxVolBytes, ed2), edit_uint64(mr.VolCapacityBytes, ed3), mr.VolStatus, mr.Slot, mr.MaxVolJobs, mr.MaxVolFiles); - Dmsg5(200, "get_media_record PoolId=%d wanted %d, Status=%s, Slot=%d \ -MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType); + Dmsg1(200, "Vol Info: %s", bs->msg); } else { /* Not suitable volume */ bnet_fsend(bs, "1998 Volume \"%s\"not appropriate.\n", @@ -220,6 +221,11 @@ MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType); bnet_fsend(bs, "1991 Catalog Request failed: %s", db_strerror(jcr->db)); return; } + /* Set first written time if this is first job */ + if (mr.VolJobs == 0) { + mr.FirstWritten = jcr->start_time; /* use Job start time as first write */ + } + Dmsg2(200, "Update media: BefVolJobs=%u After=%u\n", mr.VolJobs, sdmr.VolJobs); /* Copy updated values to original media record */ mr.VolJobs = sdmr.VolJobs; mr.VolFiles = sdmr.VolFiles; @@ -262,11 +268,9 @@ MediaType=%s\n", mr.PoolId, jcr->PoolId, mr.VolStatus, mr.Slot, mr.MediaType); /* Finally, check Use duration expiration */ } else if (mr.VolUseDuration > 0) { - utime_t start; utime_t now = time(NULL); - start = str_to_utime(mr.cFirstWritten); /* See if Vol Use has expired */ - if (start > 0 && mr.VolUseDuration <= (now - start)) { + if (mr.VolUseDuration <= (now - mr.FirstWritten)) { Jmsg(jcr, M_INFO, 0, _("Max configured use duration exceeded. " "Marking Volume \"%s\"as Used.\n"), mr.VolumeName); strcpy(mr.VolStatus, "Used"); /* yes, mark as used */ diff --git a/bacula/src/dird/ua_input.c b/bacula/src/dird/ua_input.c index 12dd7c5268..d9e24f6641 100644 --- a/bacula/src/dird/ua_input.c +++ b/bacula/src/dird/ua_input.c @@ -165,7 +165,6 @@ void parse_command_args(UAContext *ua) *p++ = 0; /* terminate keyword and point to value */ /* Unquote quoted values */ if (*p == '"') { - Dmsg1(000, "Start with quote: %s\n", p); for (n = q = ++p; *p && *p != '"'; ) { if (*p == '\\') { p++; diff --git a/bacula/src/filed/backup.c b/bacula/src/filed/backup.c index 81981da13a..ee06f268e5 100644 --- a/bacula/src/filed/backup.c +++ b/bacula/src/filed/backup.c @@ -188,8 +188,10 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) stream = encode_attribsEx(jcr, attribsEx, ff_pkt); Dmsg3(200, "File %s\nattribs=%s\nattribsEx=%s\n", ff_pkt->fname, attribs, attribsEx); + P(jcr->mutex); jcr->JobFiles++; /* increment number of files sent */ pm_strcpy(&jcr->last_fname, ff_pkt->fname); + V(jcr->mutex); /* * Send Attributes header to Storage daemon @@ -204,8 +206,8 @@ static int save_file(FF_PKT *ff_pkt, void *ijcr) } Dmsg1(100, ">stored: attrhdr %s\n", sd->msg); - /* - * Send file attributes to Storage daemon + /* + * Send file attributes to Storage daemon * File_index * File type * Filename (full path) diff --git a/bacula/src/filed/restore.c b/bacula/src/filed/restore.c index be6be79c95..a46f91dde4 100644 --- a/bacula/src/filed/restore.c +++ b/bacula/src/filed/restore.c @@ -7,7 +7,7 @@ * */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -256,7 +256,9 @@ void do_restore(JCR *jcr) break; case CF_EXTRACT: extract = TRUE; + P(jcr->mutex); pm_strcpy(&jcr->last_fname, ofile); + V(jcr->mutex); /* Fall-through wanted */ case CF_CREATED: jcr->JobFiles++; diff --git a/bacula/src/filed/status.c b/bacula/src/filed/status.c index a6d7ba4469..dcb52767a1 100755 --- a/bacula/src/filed/status.c +++ b/bacula/src/filed/status.c @@ -7,7 +7,7 @@ * */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -97,7 +97,9 @@ static void do_status(void sendit(char *msg, int len, void *sarg), void *arg) edit_uint64_with_commas(njcr->num_files_examined, b1)); sendit(msg, len, arg); if (njcr->JobFiles > 0) { + P(njcr->mutex); len = Mmsg(&msg, _(" Processing file: %s\n"), njcr->last_fname); + V(njcr->mutex); sendit(msg, len, arg); } diff --git a/bacula/src/filed/verify.c b/bacula/src/filed/verify.c index 832c506806..231dc7686e 100644 --- a/bacula/src/filed/verify.c +++ b/bacula/src/filed/verify.c @@ -150,8 +150,10 @@ static int verify_file(FF_PKT *ff_pkt, void *pkt) encode_stat(attribs, &ff_pkt->statp); + P(jcr->mutex); jcr->JobFiles++; /* increment number of files sent */ pm_strcpy(&jcr->last_fname, ff_pkt->fname); + V(jcr->mutex); /* diff --git a/bacula/src/filed/verify_vol.c b/bacula/src/filed/verify_vol.c index 36fdff151b..45f2eeb6c4 100644 --- a/bacula/src/filed/verify_vol.c +++ b/bacula/src/filed/verify_vol.c @@ -8,7 +8,7 @@ * */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -159,9 +159,11 @@ void do_verify_volume(JCR *jcr) } else { *lname = 0; } + P(jcr->mutex); jcr->JobFiles++; jcr->num_files_examined++; pm_strcpy(&jcr->last_fname, fname); /* last file examined */ + V(jcr->mutex); /* * Send file attributes to Director diff --git a/bacula/src/findlib/find.c b/bacula/src/findlib/find.c index d7fc75fb89..0f3af61761 100644 --- a/bacula/src/findlib/find.c +++ b/bacula/src/findlib/find.c @@ -31,7 +31,7 @@ /* Imported functions */ int find_one_file(FF_PKT *ff, int handle_file(FF_PKT *ff_pkt, void *hpkt), void *pkt, char *p, dev_t parent_device, int top_level); -void term_find_one(FF_PKT *ff); +int term_find_one(FF_PKT *ff); size_t name_max; /* filename max length */ size_t path_max; /* path name max length */ @@ -128,12 +128,14 @@ find_files(FF_PKT *ff, int callback(FF_PKT *ff_pkt, void *hpkt), void *his_pkt) * Terminate find_files() and release * all allocated memory */ -void +int term_find_files(FF_PKT *ff) { + int hard_links; + term_include_exclude_files(ff); free_pool_memory(ff->sys_fname); - term_find_one(ff); + hard_links = term_find_one(ff); free(ff); - return; + return hard_links; } diff --git a/bacula/src/findlib/find_one.c b/bacula/src/findlib/find_one.c index 0b783f0cc2..5f2f3468ea 100755 --- a/bacula/src/findlib/find_one.c +++ b/bacula/src/findlib/find_one.c @@ -152,10 +152,10 @@ find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt } /* File not previously dumped. Chain it into our list. */ - lp = (struct f_link *)bmalloc(sizeof (struct f_link) + strlen(fname)); + lp = (struct f_link *)bmalloc(sizeof(struct f_link) + strlen(fname) +1); lp->ino = ff_pkt->statp.st_ino; lp->dev = ff_pkt->statp.st_dev; - strcpy (lp->name, fname); + strcpy(lp->name, fname); lp->next = ff_pkt->linklist; ff_pkt->linklist = lp; } @@ -321,9 +321,10 @@ find_one_file(FF_PKT *ff_pkt, int handle_file(FF_PKT *ff, void *hpkt), void *pkt return handle_file(ff_pkt, pkt); } -void term_find_one(FF_PKT *ff) +int term_find_one(FF_PKT *ff) { struct f_link *lp, *lc; + int count = 0; /* Free up list of hard linked files */ for (lp = ff->linklist; lp;) { @@ -331,7 +332,8 @@ void term_find_one(FF_PKT *ff) lp = lp->next; if (lc) { free(lc); + count++; } } - return; + return count; } diff --git a/bacula/src/findlib/protos.h b/bacula/src/findlib/protos.h index e2f4960e90..e58e9af2ff 100644 --- a/bacula/src/findlib/protos.h +++ b/bacula/src/findlib/protos.h @@ -40,7 +40,7 @@ int create_file(void *jcr, char *fname, char *ofile, char *lname, FF_PKT *init_find_files(); void set_find_options(FF_PKT *ff, int incremental, time_t mtime); int find_files(FF_PKT *ff, int sub(FF_PKT *ff_pkt, void *hpkt), void *pkt); -void term_find_files(FF_PKT *ff); +int term_find_files(FF_PKT *ff); /* From match.c */ void init_include_exclude_files(FF_PKT *ff); diff --git a/bacula/src/lib/btime.c b/bacula/src/lib/btime.c index f17f1de64c..77df8f01c4 100644 --- a/bacula/src/lib/btime.c +++ b/bacula/src/lib/btime.c @@ -56,10 +56,16 @@ utime_t str_to_utime(char *str) if (sscanf(str, "%d-%d-%d %d:%d:%d", &tm.tm_year, &tm.tm_mon, &tm.tm_mday, &tm.tm_hour, &tm.tm_min, &tm.tm_sec) != 6) { - return -1; + return 0; + } + if (tm.tm_mon > 0) { + tm.tm_mon--; + } + if (tm.tm_year >= 1900) { + tm.tm_year -= 1900; + } else { + tm.tm_year = 0; } - tm.tm_mon--; - tm.tm_year -= 1900; return (utime_t)mktime(&tm); } diff --git a/bacula/src/stored/acquire.c b/bacula/src/stored/acquire.c index d57b4f03b4..c9b16f152e 100644 --- a/bacula/src/stored/acquire.c +++ b/bacula/src/stored/acquire.c @@ -6,7 +6,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -253,7 +253,7 @@ int release_device(JCR *jcr, DEVICE *dev) dev->VolCatInfo.VolCatFiles++; /* increment number of files */ dev->VolCatInfo.VolCatJobs++; /* increment number of jobs */ /* Note! do volume update before close, which zaps VolCatInfo */ - Dmsg0(100, "dir_update_vol_info. Release\n"); + Dmsg0(200, "dir_update_vol_info. Release0\n"); dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */ if (!dev_is_tape(dev) || !(dev->capabilities & CAP_ALWAYSOPEN)) { @@ -265,7 +265,7 @@ int release_device(JCR *jcr, DEVICE *dev) } else { Dmsg0(100, "dir_create_jobmedia_record. Release\n"); dir_create_jobmedia_record(jcr); - Dmsg0(100, "dir_update_vol_info. Release\n"); + Dmsg0(200, "dir_update_vol_info. Release1\n"); dev->VolCatInfo.VolCatJobs++; /* increment number of jobs */ dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* send Volume info to Director */ } diff --git a/bacula/src/stored/askdir.c b/bacula/src/stored/askdir.c index 64df91039f..d49ca21df2 100644 --- a/bacula/src/stored/askdir.c +++ b/bacula/src/stored/askdir.c @@ -7,7 +7,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as diff --git a/bacula/src/stored/block.c b/bacula/src/stored/block.c index ce3c923489..7652d6c6f1 100644 --- a/bacula/src/stored/block.c +++ b/bacula/src/stored/block.c @@ -533,13 +533,13 @@ reread: Dmsg1(000, "%s", dev->errmsg); /* Attempt to reposition to re-read the block */ if (dev->state & ST_TAPE) { - Dmsg0(000, "Backspace record for reread.\n"); + Dmsg0(100, "Backspace record for reread.\n"); if (bsf_dev(dev, 1) != 0) { Emsg0(M_ERROR, 0, dev->errmsg); return 0; } } else { - Dmsg0(000, "Seek to beginning of block for reread.\n"); + Dmsg0(100, "Seek to beginning of block for reread.\n"); off_t pos = lseek(dev->fd, (off_t)0, SEEK_CUR); /* get curr pos */ pos -= block->read_len; lseek(dev->fd, pos, SEEK_SET); diff --git a/bacula/src/stored/device.c b/bacula/src/stored/device.c index 66894d0596..e91d8ddf4a 100644 --- a/bacula/src/stored/device.c +++ b/bacula/src/stored/device.c @@ -29,7 +29,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -110,7 +110,7 @@ int fixup_device_block_write_error(JCR *jcr, DEVICE *dev, DEV_BLOCK *block) } strcpy(dev->VolCatInfo.VolCatStatus, "Full"); - Dmsg2(100, "Call update_vol_info Stat=%s Vol=%s\n", + Dmsg2(200, "Call update_vol_info Stat=%s Vol=%s\n", dev->VolCatInfo.VolCatStatus, dev->VolCatInfo.VolCatName); if (!dir_update_volume_info(jcr, &dev->VolCatInfo, 0)) { /* send Volume info to Director */ Jmsg(jcr, M_ERROR, 0, _("Could not update Volume info Volume=%s Job=%s\n"), diff --git a/bacula/src/stored/mount.c b/bacula/src/stored/mount.c index 88de341080..9402c18de7 100644 --- a/bacula/src/stored/mount.c +++ b/bacula/src/stored/mount.c @@ -8,7 +8,7 @@ * Version $Id$ */ /* - Copyright (C) 2000, 2001, 2002 Kern Sibbald and John Walker + Copyright (C) 2000-2003 Kern Sibbald and John Walker This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -208,6 +208,7 @@ mount_error: Setting slot to zero in catalog.\n"), jcr->VolCatInfo.VolCatName, jcr->VolCatInfo.Slot); jcr->VolCatInfo.Slot = 0; /* invalidate slot */ + Dmsg0(200, "update vol info in mount\n"); dir_update_volume_info(jcr, &jcr->VolCatInfo, 1); /* set slot */ } Dmsg0(100, "Default\n"); @@ -263,10 +264,10 @@ mount_error: /* Recreate a correct volume label and return it in the block */ write_volume_label_to_block(jcr, dev, block); /* Set or reset Volume statistics */ - dev->VolCatInfo.VolCatJobs = 1; - dev->VolCatInfo.VolCatFiles = 1; + dev->VolCatInfo.VolCatJobs = 0; + dev->VolCatInfo.VolCatFiles = 0; dev->VolCatInfo.VolCatErrors = 0; - dev->VolCatInfo.VolCatBlocks = 1; + dev->VolCatInfo.VolCatBlocks = 0; if (recycle) { dev->VolCatInfo.VolCatMounts++; dev->VolCatInfo.VolCatRecycles++; @@ -277,7 +278,7 @@ mount_error: dev->VolCatInfo.VolCatReads = 1; } strcpy(dev->VolCatInfo.VolCatStatus, "Append"); - Dmsg0(100, "dir_update_vol_info. Set Append\n"); + Dmsg0(200, "dir_update_vol_info. Set Append\n"); dir_update_volume_info(jcr, &dev->VolCatInfo, 1); /* indicate doing relabel */ if (recycle) { Jmsg(jcr, M_INFO, 0, _("Recycled volume %s on device %s, all previous data lost.\n"), @@ -302,7 +303,7 @@ mount_error: Jmsg(jcr, M_INFO, 0, _("Marking Volume %s in Error in Catalog.\n"), jcr->VolumeName); strcpy(dev->VolCatInfo.VolCatStatus, "Error"); - Dmsg0(100, "dir_update_vol_info. Set Error.\n"); + Dmsg0(200, "dir_update_vol_info. Set Error.\n"); dir_update_volume_info(jcr, &dev->VolCatInfo, 0); goto mount_next_vol; } @@ -320,12 +321,13 @@ mount_error: The number of files mismatch! Volume=%d Catalog=%d\n"), dev_file(dev)+1, dev->VolCatInfo.VolCatFiles); strcpy(dev->VolCatInfo.VolCatStatus, "Error"); - Dmsg0(100, "dir_update_vol_info. Set Error.\n"); + Dmsg0(200, "dir_update_vol_info. Set Error.\n"); dir_update_volume_info(jcr, &dev->VolCatInfo, 0); goto mount_next_vol; } } dev->VolCatInfo.VolCatMounts++; /* Update mounts */ + Dmsg1(200, "update volinfo mounts=%d\n", dev->VolCatInfo.VolCatMounts); dir_update_volume_info(jcr, &dev->VolCatInfo, 0); /* Return an empty block */ empty_block(block); /* we used it for reading so set for write */ diff --git a/bacula/src/tools/testfind.c b/bacula/src/tools/testfind.c index c5cf5e7278..8b0ffa03b9 100644 --- a/bacula/src/tools/testfind.c +++ b/bacula/src/tools/testfind.c @@ -46,7 +46,7 @@ main (int argc, char *const *argv) { FF_PKT *ff; char name[1000]; - int i, ch; + int i, ch, hard_links; while ((ch = getopt(argc, argv, "ad:?")) != -1) { switch (ch) { @@ -87,16 +87,17 @@ main (int argc, char *const *argv) } find_files(ff, print_file, NULL); - term_find_files(ff); + hard_links = term_find_files(ff); printf(_("\ Total files : %d\n\ Max file length: %d\n\ Max path length: %d\n\ Files truncated: %d\n\ -Paths truncated: %d\n"), +Paths truncated: %d\n\ +Hard links : %d\n"), num_files, max_file_len, max_path_len, - trunc_fname, trunc_path); + trunc_fname, trunc_path, hard_links); close_memory_pool(); sm_dump(False); diff --git a/bacula/src/version.h b/bacula/src/version.h index a70ac7728c..a655cc68b5 100644 --- a/bacula/src/version.h +++ b/bacula/src/version.h @@ -1,8 +1,8 @@ /* */ #define VERSION "1.29" #define VSTRING "1" -#define DATE "9 January 2003" -#define LSMDATE "09Jan03" +#define DATE "12 January 2003" +#define LSMDATE "12Jan03" /* Debug flags */ #define DEBUG 1