Skip to content

Commit

Permalink
.bvfs_update: fix to create all required cache entries
Browse files Browse the repository at this point in the history
During the restructuring of the database code,
an error has been introduced to this function.
This error has caused that cache entries are not generated in all cases.
This commit fixes this.

Fixes #890: .bvfs_update does not always create all cache entries.
  • Loading branch information
joergsteffens committed Jan 13, 2018
1 parent 1c8590b commit 43b2bfe
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/cats/bvfs.c
Expand Up @@ -125,7 +125,7 @@ void B_DB::build_path_hierarchy(JCR *jcr, pathid_cache &ppathid_cache,
* In order to avoid the full loop, we consider that if a dir is already in the
* PathHierarchy table, then there is no need to calculate all the hierarchy
*/
while (path && *path) {
while (new_path && *new_path) {
if (ppathid_cache.lookup(pathid)) {
/*
* It's already in the cache. We can leave, no time to waste here,
Expand All @@ -145,7 +145,7 @@ void B_DB::build_path_hierarchy(JCR *jcr, pathid_cache &ppathid_cache,
if (sql_num_rows() > 0) {
ppathid_cache.insert(pathid);
/* This dir was in the db ...
* It means we can leave, the tree has allready been built for
* It means we can leave, the tree has already been built for
* this dir
*/
goto bail_out;
Expand All @@ -167,7 +167,8 @@ void B_DB::build_path_hierarchy(JCR *jcr, pathid_cache &ppathid_cache,
}

edit_uint64(parent.PathId, pathid);
new_path = path; /* already done */
/* continue with parent directory */
new_path = path;
}
}
}
Expand Down

0 comments on commit 43b2bfe

Please sign in to comment.