From: Jordan Justen Date: Sat, 14 Oct 2017 05:04:52 +0000 (-0700) Subject: disk_cache: Fix issue reading GLSL metadata X-Git-Tag: upstream/18.1.0~4588 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e5b141634cff3aa1f68699f39a2c3794261a32b1;p=platform%2Fupstream%2Fmesa.git disk_cache: Fix issue reading GLSL metadata This would cause the read of the metadata content to fail, which would prevent the linking from being skipped. Seen on Rocket League with i965 shader cache. Fixes: b86ecea3446e "util/disk_cache: write cache item metadata to disk" Cc: Timothy Arceri Signed-off-by: Jordan Justen Reviewed-by: Timothy Arceri Reviewed-by: Jason Ekstrand Reviewed-by: Kenneth Graunke --- diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c index e38cacb..fde6e2e 100644 --- a/src/util/disk_cache.c +++ b/src/util/disk_cache.c @@ -1110,7 +1110,7 @@ disk_cache_get(struct disk_cache *cache, const cache_key key, size_t *size) * TODO: pass the metadata back to the caller and do some basic * validation. */ - cache_item_md_size += sizeof(cache_key); + cache_item_md_size += num_keys * sizeof(cache_key); ret = lseek(fd, num_keys * sizeof(cache_key), SEEK_CUR); if (ret == -1) goto fail;