@@ -274,6 +274,7 @@ impl Volume {
274
274
sv_vec
275
275
}
276
276
277
+ #[ allow( clippy:: if_same_then_else) ]
277
278
pub fn read_only_parent_for_lba_range (
278
279
& self ,
279
280
start : u64 ,
@@ -282,7 +283,10 @@ impl Volume {
282
283
if let Some ( ref read_only_parent) = self . read_only_parent {
283
284
// Check if the scrubber has passed this offset
284
285
let scrub_point = self . scrub_point . load ( Ordering :: SeqCst ) ;
285
- if start + length <= scrub_point {
286
+ if scrub_point >= read_only_parent. lba_range . end {
287
+ // No need to check ROP, the scrub is done.
288
+ None
289
+ } else if start + length <= scrub_point {
286
290
None
287
291
} else {
288
292
read_only_parent. lba_range_coverage ( start, length)
@@ -3009,6 +3013,14 @@ mod test {
3009
3013
block, size, scrub_point,
3010
3014
) ;
3011
3015
assert ! ( r. is_none( ) ) ;
3016
+ } else if scrub_point >= parent_blocks {
3017
+ // We have completed the scrub of the ROP, so we
3018
+ // go directly to the SubVolume
3019
+ println ! (
3020
+ "scrub_point {} >= size {}, scrub done. No check" ,
3021
+ scrub_point, parent_blocks
3022
+ ) ;
3023
+ assert ! ( r. is_none( ) ) ;
3012
3024
} else {
3013
3025
// Our IO is not fully under the scrub point, but we
3014
3026
// know it's still below the
0 commit comments