Skip to content

Commit

Permalink
fix: don't call check_section() in filesystem ctor (fixes gh #183)
Browse files Browse the repository at this point in the history
This regression was introduced in the v0.7.3 release and caused each
section header to be read from the filesystem image at mount time,
defeating the purpose of the section index.
  • Loading branch information
mhx committed Dec 28, 2023
1 parent 7cc60d0 commit 0829835
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/dwarfs/filesystem_v2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,11 @@ filesystem_<LoggerPolicy>::filesystem_(
section_map sections;

while (auto s = parser.next_section()) {
check_section(*s);
// Don't use check_section() here because it'll trigger the lazy
// section to load, defeating the purpose of the section index.
// See github issue #183.
LOG_DEBUG << "section " << s->name() << " @ " << s->start() << " ["
<< s->length() << " bytes]";

if (s->type() == section_type::BLOCK) {
cache.insert(*s);
Expand Down

0 comments on commit 0829835

Please sign in to comment.