Skip to content

Commit

Permalink
Small fix to prefetch ranges aggregation
Browse files Browse the repository at this point in the history
When after openzfs#16022 adding new range we aggregate more than two
existing ranges, that should be very rare, only if several streams
overlap, we may need to zero not the last range, but some earlier.

Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by:	Alexander Motin <[email protected]>
Sponsored by:	iXsystems, Inc.
Closes openzfs#16072
  • Loading branch information
amotin authored and behlendorf committed Apr 19, 2024
1 parent 97d7228 commit f4ce02a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions module/zfs/dmu_zfetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ dmu_zfetch_future(zstream_t *zs, uint64_t blkid, uint64_t nblks)
zs->zs_ranges[f].start = zs->zs_ranges[l].start;
zs->zs_ranges[f].end = zs->zs_ranges[l].end;
}
zs->zs_ranges[ZFETCH_RANGES - 1].start = 0;
zs->zs_ranges[ZFETCH_RANGES - 1].end = 0;
zs->zs_ranges[f].start = 0;
zs->zs_ranges[f].end = 0;
}
} else if (i < ZFETCH_RANGES) {
/* Got no intersecting ranges, insert new one. */
Expand Down

0 comments on commit f4ce02a

Please sign in to comment.