Skip to content

Commit

Permalink
DeadPage Reference Counter Test Case (#178)
Browse files Browse the repository at this point in the history
* llfs dead page recycling test case to recreation llfs recycler bug

* final changes with death test

* after pulling script changes

* some style changes

* review comment changes

* more review changes

* updated test case

---------

Co-authored-by: Bhaskar Bora <[email protected]>
  • Loading branch information
bhaskarbora2 and Bhaskar Bora authored Dec 17, 2024
1 parent 0c8d97b commit b405972
Show file tree
Hide file tree
Showing 5 changed files with 401 additions and 5 deletions.
3 changes: 3 additions & 0 deletions src/llfs/ioring_page_file_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,9 @@ void IoRingPageFileDevice::read_some(PageId page_id, i64 page_offset_in_file,
void IoRingPageFileDevice::drop(PageId id, WriteHandler&& handler)
{
// TODO [tastolfi 2021-06-11] - trim at device level?
// Note that we are not clearing the data blocks here. This behavior is copied replicated for
// SimulatedPageDevice drop() too. Thus, when modifying this function do visit
// SimulatedPageDevice::Impl::drop() and make sure things are updated there.
(void)id;
handler(OkStatus());
}
Expand Down
5 changes: 3 additions & 2 deletions src/llfs/simulated_page_device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,10 @@ void SimulatedPageDevice::Impl::drop(u32 device_create_step, PageId page_id,
return;
}

// No failure injected; erase the DataBlock at the given index and notify the op.
// No failure injected.
// Note that we are not not erasing the data block as we want to mimic the actual
// io_ring Page Device behavior.
//
locked_blocks->erase(block_i);
op->set_block_result(block_i - block_0, batt::OkStatus());
});
});
Expand Down
Loading

0 comments on commit b405972

Please sign in to comment.