cluster-cache: fix get() not assigning data buffer to another cache entry after evicting it
This commit is contained in:
@@ -162,12 +162,14 @@ enum ec3_status cluster_cache_get(
|
|||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
entry->e_data = buf;
|
||||||
|
|
||||||
size_t nr_read = 0;
|
size_t nr_read = 0;
|
||||||
enum b_status status2 = b_file_read(
|
enum b_status status2 = b_file_read(
|
||||||
cache->c_storage,
|
cache->c_storage,
|
||||||
entry->e_storage_offset,
|
entry->e_storage_offset,
|
||||||
entry->e_length,
|
entry->e_length,
|
||||||
buf,
|
entry->e_data,
|
||||||
&nr_read);
|
&nr_read);
|
||||||
|
|
||||||
if (!B_OK(status2)) {
|
if (!B_OK(status2)) {
|
||||||
@@ -178,7 +180,7 @@ enum ec3_status cluster_cache_get(
|
|||||||
return EC3_ERR_IO_FAILURE;
|
return EC3_ERR_IO_FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
memcpy(out, buf, nr_read);
|
memcpy(out, entry->e_data, nr_read);
|
||||||
*cluster_size = nr_read;
|
*cluster_size = nr_read;
|
||||||
return EC3_SUCCESS;
|
return EC3_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user