Skip to content

Commit

Permalink
Merge pull request #343 from BigVan/fix_prefetch
Browse files Browse the repository at this point in the history
[Fix] access deleted point in prefetch thread.
  • Loading branch information
BigVan authored Aug 8, 2024
2 parents 7093da0 + 0fe520b commit 1059cf4
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/image_file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ IFile *ImageFile::__open_ro_remote(const std::string &dir, const std::string &di
remote_file->ioctl(SET_LOCAL_DIR, dir);
} else {
LOG_WARN(
"local dir of layer %d (%s) didn't set, skip background anyway",
"local dir of layer ` (`) didn't set, skip background anyway",
layer_index, digest.c_str());
}

Expand Down Expand Up @@ -364,10 +364,6 @@ LSMT::IFileRO *ImageFile::open_lowers(std::vector<ImageConfigNS::LayerConfig> &l
}
LOG_INFO("LSMT::open_files_ro(files, `) success", lowers.size());

if (m_prefetcher != nullptr) {
m_prefetcher->replay((IFile*)ret);
}

return ret;

ERROR_EXIT:
Expand Down Expand Up @@ -508,6 +504,9 @@ int ImageFile::init_image_file() {
if (conf.download().enable() && !record_no_download) {
start_bk_dl_thread();
}
if (m_prefetcher != nullptr) {
m_prefetcher->replay(m_file);
}
return 1;

ERROR_EXIT:
Expand Down

0 comments on commit 1059cf4

Please sign in to comment.