cluster-cache: fix get() not assigning data buffer to another cache entry after evicting it

This commit is contained in:
2025-02-27 15:51:38 +00:00
parent 47fbca38f6
commit 0f9f798691

View File

@@ -162,12 +162,14 @@ enum ec3_status cluster_cache_get(
return status;
}
entry->e_data = buf;
size_t nr_read = 0;
enum b_status status2 = b_file_read(
cache->c_storage,
entry->e_storage_offset,
entry->e_length,
buf,
entry->e_data,
&nr_read);
if (!B_OK(status2)) {
@@ -178,7 +180,7 @@ enum ec3_status cluster_cache_get(
return EC3_ERR_IO_FAILURE;
}
memcpy(out, buf, nr_read);
memcpy(out, entry->e_data, nr_read);
*cluster_size = nr_read;
return EC3_SUCCESS;
}