From: Eric Bollengier Date: Sun, 2 Aug 2009 19:39:48 +0000 (+0200) Subject: fix the basefile catalog update X-Git-Tag: Release-5.0.0~344 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f7a046febe484280304d598bf51b19658a897ccd;p=bacula%2Fbacula fix the basefile catalog update --- diff --git a/bacula/src/filed/accurate.c b/bacula/src/filed/accurate.c index 287dd4421c..1541fa889d 100644 --- a/bacula/src/filed/accurate.c +++ b/bacula/src/filed/accurate.c @@ -113,7 +113,8 @@ static bool accurate_send_base_file_list(JCR *jcr) foreach_htable(elt, jcr->file_list) { if (elt->seen) { Dmsg2(dbglvl, "base file fname=%s seen=%i\n", elt->fname, elt->seen); - decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */ + /* TODO: skip the decode and use directly the lstat field */ + decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */ ff_pkt->fname = elt->fname; ff_pkt->statp = statc; encode_and_send_attributes(jcr, ff_pkt, stream); @@ -154,6 +155,7 @@ static bool accurate_send_deleted_list(JCR *jcr) continue; } Dmsg2(dbglvl, "deleted fname=%s seen=%i\n", elt->fname, elt->seen); + /* TODO: skip the decode and use directly the lstat field */ decode_stat(elt->lstat, &statc, &LinkFIc); /* decode catalog stat */ ff_pkt->fname = elt->fname; ff_pkt->statp.st_mtime = statc.st_mtime; @@ -376,14 +378,19 @@ bool accurate_check_file(JCR *jcr, FF_PKT *ff_pkt) } #endif - /* compute space saved with basefile */ - if (jcr->get_JobLevel() == L_FULL && !stat) { - jcr->base_size += ff_pkt->statp.st_size; + /* In Incr/Diff accurate mode, we mark all files as seen + * When in Full+Base mode, we mark only if the file match exactly + */ + if (jcr->get_JobLevel() == L_FULL) { + if (!stat) { + /* compute space saved with basefile */ + jcr->base_size += ff_pkt->statp.st_size; + accurate_mark_file_as_seen(jcr, &elt); + } + } else { + accurate_mark_file_as_seen(jcr, &elt); } - accurate_mark_file_as_seen(jcr, &elt); -// Dmsg2(dbglvl, "accurate %s = %d\n", fname, stat); - bail_out: unstrip_path(ff_pkt); return stat;