Skip to content

Commit

Permalink
Merge pull request ceph#56375 from athanatos/sjust/wip-64996-deepscru…
Browse files Browse the repository at this point in the history
…b-crash

crimson/.../scrub_events: fix progress lifetime in deep_scan_object

Reviewed-by: Yingxin Cheng <[email protected]>
Reviewed-by: Radoslaw Zarzynski <[email protected]>
Reviewed-by: Chunmei Liu <[email protected]>
  • Loading branch information
athanatos authored Mar 24, 2024
2 parents b3cfa10 + 3276ad5 commit df1ae4d
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/crimson/osd/osd_operations/scrub_events.cc
Original file line number Diff line number Diff line change
Expand Up @@ -258,9 +258,10 @@ ScrubScan::ifut<> ScrubScan::deep_scan_object(
DEBUGDPP("obj: {}", pg, obj);
using crimson::common::local_conf;
auto &entry = ret.objects[obj.hobj];
auto progress_ref = std::make_unique<obj_scrub_progress_t>();
auto &progress = *progress_ref;
return interruptor::repeat(
[FNAME, this, progress = obj_scrub_progress_t(),
&obj, &entry, &pg]() mutable
[FNAME, this, &progress, &obj, &entry, &pg]()
-> interruptible_future<seastar::stop_iteration> {
if (progress.offset) {
DEBUGDPP("op: {}, obj: {}, progress: {} scanning data",
Expand All @@ -272,7 +273,10 @@ ScrubScan::ifut<> ScrubScan::deep_scan_object(
obj,
*(progress.offset),
stride
).safe_then([stride, &progress, &entry](auto bl) {
).safe_then([this, FNAME, stride, &obj, &progress, &entry, &pg](auto bl) {
size_t offset = *progress.offset;
DEBUGDPP("op: {}, obj: {}, progress: {} got offset {}",
pg, *this, obj, progress, offset);
progress.data_hash << bl;
if (bl.length() < stride) {
progress.offset = std::nullopt;
Expand Down Expand Up @@ -373,7 +377,7 @@ ScrubScan::ifut<> ScrubScan::deep_scan_object(
seastar::make_ready_future<seastar::stop_iteration>(
seastar::stop_iteration::yes));
}
});
}).finally([progress_ref=std::move(progress_ref)] {});
}

template class ScrubAsyncOpT<ScrubScan>;
Expand Down

0 comments on commit df1ae4d

Please sign in to comment.