Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Thumshirn <jthumshirn@suse.de>2018-10-15 13:43:06 +0200
committerJohannes Thumshirn <jthumshirn@suse.de>2018-10-15 13:43:06 +0200
commitc82ee64b16b06e7b27c1ffc679c61a8219062319 (patch)
treed57e4bc7d2c4c6ee25f39ba61ea3effdf8be6800
parent0a7a1e147726c66785a92c01b557144313cc79c7 (diff)
mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP
removal (bsc#1111841).
-rw-r--r--patches.fixes/mm-fix-bug_on-in-vmf_insert_pfn_pud-from-vm_mixedmap-removal.patch51
-rw-r--r--series.conf1
2 files changed, 52 insertions, 0 deletions
diff --git a/patches.fixes/mm-fix-bug_on-in-vmf_insert_pfn_pud-from-vm_mixedmap-removal.patch b/patches.fixes/mm-fix-bug_on-in-vmf_insert_pfn_pud-from-vm_mixedmap-removal.patch
new file mode 100644
index 0000000000..956c406175
--- /dev/null
+++ b/patches.fixes/mm-fix-bug_on-in-vmf_insert_pfn_pud-from-vm_mixedmap-removal.patch
@@ -0,0 +1,51 @@
+From: Dave Jiang <dave.jiang@intel.com>
+Date: Tue, 4 Sep 2018 15:46:16 -0700
+Subject: mm: fix BUG_ON() in vmf_insert_pfn_pud() from VM_MIXEDMAP removal
+Git-commit: 62ec0d8c4f332dedf19d6fad15ddea639044d5fe
+Patch-mainline: v4.19-rc3
+References: bsc#1111841
+
+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: e1fb4a08649 ("dax: remove VM_MIXEDMAP for fsdax and device dax")
+Signed-off-by: Dave Jiang <dave.jiang@intel.com>
+Reported-by: Vishal Verma <vishal.l.verma@intel.com>
+Tested-by: Vishal Verma <vishal.l.verma@intel.com>
+Acked-by: Jeff Moyer <jmoyer@redhat.com>
+Reviewed-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
+Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
+Acked-by: Johannes Thumshirn <jthumshirn@suse.de>
+---
+ mm/huge_memory.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/mm/huge_memory.c b/mm/huge_memory.c
+index c3bc7e9c9a2a..533f9b00147d 100644
+--- a/mm/huge_memory.c
++++ b/mm/huge_memory.c
+@@ -821,11 +821,11 @@ vm_fault_t vmf_insert_pfn_pud(struct vm_area_struct *vma, unsigned long addr,
+ * but we need to be consistent with PTEs and architectures that
+ * can't support a 'special' bit.
+ */
+- BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)));
++ BUG_ON(!(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) &&
++ !pfn_t_devmap(pfn));
+ BUG_ON((vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP)) ==
+ (VM_PFNMAP|VM_MIXEDMAP));
+ BUG_ON((vma->vm_flags & VM_PFNMAP) && is_cow_mapping(vma->vm_flags));
+- BUG_ON(!pfn_t_devmap(pfn));
+
+ if (addr < vma->vm_start || addr >= vma->vm_end)
+ return VM_FAULT_SIGBUS;
+
diff --git a/series.conf b/series.conf
index 80dabffe22..9433212eb6 100644
--- a/series.conf
+++ b/series.conf
@@ -17677,6 +17677,7 @@
patches.fixes/mac80211-don-t-Tx-a-deauth-frame-if-the-AP-forbade-T.patch
patches.fixes/mac80211-shorten-the-IBSS-debug-messages.patch
patches.fixes/mm-hugetlb-filter-out-hugetlb-pages-if-hugepage-migration-is-not-supported.patch
+ patches.fixes/mm-fix-bug_on-in-vmf_insert_pfn_pud-from-vm_mixedmap-removal.patch
patches.fixes/scsi-lpfc-Correct-MDS-diag-and-nvmet-configuration.patch
patches.drivers/scsi-hpsa-limit-transfer-length-to-1mb-not-512kb.patch
patches.drivers/gpio-adp5588-Fix-sleep-in-atomic-context-bug.patch