Commit 501470f
as400: don't let the prefetch cache bypass a Skip Read's mask
scsiDiskStartRead() consults the read-ahead prefetch cache before
deciding how to serve a read, and that cache holds sectors from a prior
ordinary contiguous read. A Skip Read gathers its sectors per the mask,
which skips and reorders relative to a straight LBA run, so serving the
linked Read10 from the cache returns contiguous data and silently
ignores the mask. The Skip Read branch sits further down the same
function, after the cache has already answered.
Invalidate the cache when a Skip Read starts in scsiDiskSkip(), so the
lookup stays a single unconditional line.
Upstream calls this latent because their AS/400 reporters all ran
PrefetchBytes=0. That does not carry over: BlueSCSI defaults
prefetchBytes to PREFETCH_BUFFER_SIZE (8192), so the path is reachable
on a stock bluescsi.ini.
Ported from z/main 1a18f841a (ZuluSCSI PR #917). Manual port: BlueSCSI
has no scsiDiskPrefetchInvalidate() helper, so this clears g_scsi_prefetch
inline the way the rest of the file already does. Upstream's first attempt
at this, an #ifdef-wrapped braceless if around the lookup, was rejected in
review as a dangling-if hazard and is not what landed.
Test plan: skipped, same reason as the preceding commit. Build verified
on Ultra.1 parent 8af62f9 commit 501470f
1 file changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3346 | 3346 | | |
3347 | 3347 | | |
3348 | 3348 | | |
| 3349 | + | |
| 3350 | + | |
| 3351 | + | |
| 3352 | + | |
| 3353 | + | |
| 3354 | + | |
| 3355 | + | |
| 3356 | + | |
| 3357 | + | |
| 3358 | + | |
| 3359 | + | |
| 3360 | + | |
| 3361 | + | |
| 3362 | + | |
3349 | 3363 | | |
3350 | 3364 | | |
3351 | 3365 | | |
| |||
0 commit comments