From a853502610181f2339b1cf96f96fbbe4ffda43a3 Mon Sep 17 00:00:00 2001 From: Marcus Holland-Moritz Date: Wed, 27 Dec 2023 22:07:31 +0100 Subject: [PATCH] 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. --- src/dwarfs/filesystem_v2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/dwarfs/filesystem_v2.cpp b/src/dwarfs/filesystem_v2.cpp index f08722dfc..daeacdabe 100644 --- a/src/dwarfs/filesystem_v2.cpp +++ b/src/dwarfs/filesystem_v2.cpp @@ -487,7 +487,11 @@ filesystem_::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);