From ce8945e82962076b4a111ae5a592794df01e82ba Mon Sep 17 00:00:00 2001 From: Ming-Hung Tsai Date: Fri, 26 Jun 2020 23:04:15 +0800 Subject: [PATCH] [io_generator] Fix address boundary for doing IO Limit the addresses to be within the specified range --- base/io_generator.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/base/io_generator.cc b/base/io_generator.cc index a808a6c..4d6ebb0 100644 --- a/base/io_generator.cc +++ b/base/io_generator.cc @@ -48,8 +48,10 @@ namespace { base::sector_t next_offset() { sector_t r = current_; current_ += block_size_; - if (current_ > end_) + if (current_ > end_) { current_ = begin_; + return begin_; + } return r; }