Skip to content

Commit 20a8e04

Browse files
apopple-nvidiaakpm00
authored andcommitted
cramfs: fix incorrect physical page address calculation
Commit 21aa65b ("mm: remove callers of pfn_t functionality") incorrectly replaced the pfn with the physical address when calling vmf_insert_mixed(). Instead the phys_to_pfn_t() call should have been replaced with PHYS_PFN(). Found by inspection after a similar issue was noted in fuse virtio_fs. Link: https://lkml.kernel.org/r/[email protected] Fixes: 21aa65b ("mm: remove callers of pfn_t functionality") Signed-off-by: Alistair Popple <[email protected]> Reviewed-by: Dev Jain <[email protected]> Reviewed-by: David Hildenbrand <[email protected]> Cc: Haiyue Wang <[email protected]> Cc: Nicolas Pitre <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 634cdfd commit 20a8e04

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/cramfs/inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ static int cramfs_physmem_mmap(struct file *file, struct vm_area_struct *vma)
412412
vm_fault_t vmf;
413413
unsigned long off = i * PAGE_SIZE;
414414
vmf = vmf_insert_mixed(vma, vma->vm_start + off,
415-
address + off);
415+
PHYS_PFN(address + off));
416416
if (vmf & VM_FAULT_ERROR)
417417
ret = vm_fault_to_errno(vmf, 0);
418418
}

0 commit comments

Comments
 (0)