Skip to content

Commit 62ec0d8

Browse files
davejiangtorvalds
authored andcommitted
mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP removal
It looks like I missed the PUD path when doing VM_MIXEDMAP removal. This can be triggered by: 1. Boot with memmap=4G!8G 2. build ndctl with destructive flag on 3. make TESTS=device-dax check [ +0.000675] kernel BUG at mm/huge_memory.c:824! Applying the same change that was applied to vmf_insert_pfn_pmd() in the original patch. Link: http://lkml.kernel.org/r/153565957352.35524.1005746906902065126.stgit@djiang5-desk3.ch.intel.com Fixes: e1fb4a0 ("dax: remove VM_MIXEDMAP for fsdax and device dax") Signed-off-by: Dave Jiang <[email protected]> Reported-by: Vishal Verma <[email protected]> Tested-by: Vishal Verma <[email protected]> Acked-by: Jeff Moyer <[email protected]> Reviewed-by: Jan Kara <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
1 parent 8a2336e commit 62ec0d8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mm/huge_memory.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -821,11 +821,11 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
821821
* but we need to be consistent with PTEs and architectures that
822822
* can't support a 'special' bit.
823823
*/
824-
BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)));
824+
BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) &&
825+
!pfn_t_devmap(pfn));
825826
BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) ==
826827
(VM_PFNMAP|VM_MIXEDMAP));
827828
BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags));
828-
BUG_ON(!pfn_t_devmap(pfn));
829829

830830
if (addr < vma->vm_start || addr >= vma->vm_end)
831831
return VM_FAULT_SIGBUS;

0 commit comments

Comments
 (0)