2 This patch fixes, at least partially, a Verify error where
3 the count of files expected did not agree with the count
4 found. There are still some cases where the expected count
5 exceeds the found probably due to the same directory being
6 examined multiple times.
8 Apply the patch to 1.36.0 with:
11 patch -p0 <1.36.0-verify.patch
17 ===================================================================
18 RCS file: /cvsroot/bacula/bacula/src/dird/bsr.c,v
19 retrieving revision 1.15
21 --- src/dird/bsr.c 24 Sep 2004 15:53:00 -0000 1.15
22 +++ src/dird/bsr.c 29 Oct 2004 22:05:24 -0000
26 /* Forward referenced functions */
27 -static int write_bsr(UAContext *ua, RBSR *bsr, FILE *fd);
28 +static uint32_t write_bsr(UAContext *ua, RBSR *bsr, FILE *fd);
29 void print_bsr(UAContext *ua, RBSR *bsr);
34 * Write the bootstrap records to file
36 -int write_bsr_file(UAContext *ua, RBSR *bsr)
37 +uint32_t write_bsr_file(UAContext *ua, RBSR *bsr)
40 POOLMEM *fname = get_pool_memory(PM_MESSAGE);
42 + uint32_t count = 0;;
45 Mmsg(fname, "%s/restore.bsr", working_directory);
50 -static int write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
51 +static uint32_t write_bsr(UAContext *ua, RBSR *bsr, FILE *fd)
54 + uint32_t total_count = 0;
57 * For a given volume, loop over all the JobMedia records.
60 fprintf(fd, "Count=%u\n", count);
62 + total_count += count;
64 write_bsr(ua, bsr->next, fd);
70 void print_bsr(UAContext *ua, RBSR *bsr)
71 Index: src/dird/protos.h
72 ===================================================================
73 RCS file: /cvsroot/bacula/bacula/src/dird/protos.h,v
74 retrieving revision 1.54
75 diff -u -r1.54 protos.h
76 --- src/dird/protos.h 24 Sep 2004 12:30:14 -0000 1.54
77 +++ src/dird/protos.h 29 Oct 2004 22:05:24 -0000
80 void free_bsr(RBSR *bsr);
81 int complete_bsr(UAContext *ua, RBSR *bsr);
82 -int write_bsr_file(UAContext *ua, RBSR *bsr);
83 +uint32_t write_bsr_file(UAContext *ua, RBSR *bsr);
84 void add_findex(RBSR *bsr, uint32_t JobId, int32_t findex);
85 RBSR_FINDEX *new_findex();
90 extern int connect_to_file_daemon(JCR *jcr, int retry_interval,
91 - int max_retry_time, int verbose);
92 + int max_retry_time, int verbose);
93 extern int send_include_list(JCR *jcr);
94 extern int send_exclude_list(JCR *jcr);
95 extern int send_bootstrap_file(JCR *jcr);
97 extern int get_attributes_and_put_in_catalog(JCR *jcr);
98 extern int get_attributes_and_compare_to_catalog(JCR *jcr, JobId_t JobId);
99 extern int put_file_into_catalog(JCR *jcr, long file_index, char *fname,
100 - char *link, char *attr, int stream);
101 + char *link, char *attr, int stream);
102 extern void get_level_since_time(JCR *jcr, char *since, int since_len);
103 extern int send_run_before_and_after_commands(JCR *jcr);
108 extern bool connect_to_storage_daemon(JCR *jcr, int retry_interval,
109 - int max_retry_time, int verbose);
110 + int max_retry_time, int verbose);
111 extern int start_storage_daemon_job(JCR *jcr);
112 extern int start_storage_daemon_message_thread(JCR *jcr);
113 extern int bget_dirmsg(BSOCK *bs);
114 @@ -149,28 +149,28 @@
115 void free_ua_context(UAContext *ua);
118 -STORE *select_storage_resource(UAContext *ua);
119 -JOB *select_job_resource(UAContext *ua);
120 -JOB *select_restore_job_resource(UAContext *ua);
121 -CLIENT *select_client_resource(UAContext *ua);
122 +STORE *select_storage_resource(UAContext *ua);
123 +JOB *select_job_resource(UAContext *ua);
124 +JOB *select_restore_job_resource(UAContext *ua);
125 +CLIENT *select_client_resource(UAContext *ua);
126 FILESET *select_fileset_resource(UAContext *ua);
127 -int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
128 -int select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
129 -bool select_pool_dbr(UAContext *ua, POOL_DBR *pr);
130 -int select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
132 -void start_prompt(UAContext *ua, const char *msg);
133 -void add_prompt(UAContext *ua, const char *prompt);
134 -int do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt, int max_prompt);
135 -CAT *get_catalog_resource(UAContext *ua);
136 +int select_pool_and_media_dbr(UAContext *ua, POOL_DBR *pr, MEDIA_DBR *mr);
137 +int select_media_dbr(UAContext *ua, MEDIA_DBR *mr);
138 +bool select_pool_dbr(UAContext *ua, POOL_DBR *pr);
139 +int select_client_dbr(UAContext *ua, CLIENT_DBR *cr);
141 +void start_prompt(UAContext *ua, const char *msg);
142 +void add_prompt(UAContext *ua, const char *prompt);
143 +int do_prompt(UAContext *ua, const char *automsg, const char *msg, char *prompt, int max_prompt);
144 +CAT *get_catalog_resource(UAContext *ua);
145 STORE *get_storage_resource(UAContext *ua, int use_default);
146 -int get_media_type(UAContext *ua, char *MediaType, int max_media);
147 -bool get_pool_dbr(UAContext *ua, POOL_DBR *pr);
148 -int get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
149 +int get_media_type(UAContext *ua, char *MediaType, int max_media);
150 +bool get_pool_dbr(UAContext *ua, POOL_DBR *pr);
151 +int get_client_dbr(UAContext *ua, CLIENT_DBR *cr);
152 POOL *get_pool_resource(UAContext *ua);
153 POOL *select_pool_resource(UAContext *ua);
154 CLIENT *get_client_resource(UAContext *ua);
155 -int get_job_dbr(UAContext *ua, JOB_DBR *jr);
156 +int get_job_dbr(UAContext *ua, JOB_DBR *jr);
158 int find_arg_keyword(UAContext *ua, const char **list);
159 int find_arg(UAContext *ua, const char *keyword);