From 3d3e7f5cf3e104fdda83d225384e26053422f369 Mon Sep 17 00:00:00 2001 From: OBattler Date: Mon, 30 Oct 2023 20:09:55 +0100 Subject: [PATCH] Fixed a signedness mess-up in disk/hdd.c, fixes SCSI disk hangs when using non-RAM disk timings. --- src/disk/hdd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/disk/hdd.c b/src/disk/hdd.c index 5d9517747..3bb15c241 100644 --- a/src/disk/hdd.c +++ b/src/disk/hdd.c @@ -210,7 +210,7 @@ hdd_readahead_update(hard_disk_t *hdd) uint64_t elapsed_cycles; double elapsed_us; double seek_time; - uint32_t max_read_ahead; + int32_t max_read_ahead; uint32_t space_needed; hdd_cache_t *cache = &hdd->cache; @@ -224,7 +224,7 @@ hdd_readahead_update(hard_disk_t *hdd) seek_time = 0.0; - for (uint32_t i = 0; i < max_read_ahead; i++) { + for (int32_t i = 0; i < max_read_ahead; i++) { seek_time += hdd_seek_get_time(hdd, segment->ra_addr, HDD_OP_READ, 1, elapsed_us - seek_time); if (seek_time > elapsed_us) break;