mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-09 12:28:13 -04:00
fix: don't call check_section() in filesystem ctor (fixes gh #183)
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.
This commit is contained in:
parent
dc904ba730
commit
67a4de0d52
@ -524,11 +524,17 @@ filesystem_<LoggerPolicy>::filesystem_(
|
||||
section_map sections;
|
||||
|
||||
while (auto s = parser.next_section()) {
|
||||
check_section(*s);
|
||||
|
||||
if (s->type() == section_type::BLOCK) {
|
||||
// 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]";
|
||||
|
||||
cache.insert(*s);
|
||||
} else {
|
||||
check_section(*s);
|
||||
|
||||
if (!s->check_fast(*mm_)) {
|
||||
DWARFS_THROW(runtime_error, "checksum error in section: " + s->name());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user