nvme_disk: Correct get_memory_map invocation.
Passing "1" as the bytes argument instead of "0" means that get_memory_map would never return an error in the case that one physical_entry was not enough for the vaddr's map. This reveals the true cause of the disk corruptions: libnvme is assuming some of the passed buffers are physically contiguous, and they are not.
This commit is contained in:
@@ -81,10 +81,10 @@ phys_addr_t
|
|||||||
nvme_mem_vtophys(void* vaddr)
|
nvme_mem_vtophys(void* vaddr)
|
||||||
{
|
{
|
||||||
physical_entry entry;
|
physical_entry entry;
|
||||||
status_t status = get_memory_map((void*)vaddr, 1, &entry, 1);
|
status_t status = get_memory_map((void*)vaddr, 0, &entry, 1);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
panic("nvme: get_memory_map failed for %p, error %08" B_PRIx32 "\n",
|
panic("nvme: get_memory_map failed for %p: %s\n",
|
||||||
(void*)vaddr, status);
|
(void*)vaddr, strerror(status));
|
||||||
return NVME_VTOPHYS_ERROR;
|
return NVME_VTOPHYS_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user