summaryrefslogtreecommitdiff
path: root/mm/huge_memory.c
diff options
context:
space:
mode:
authorMichael Bestas <mkbestas@lineageos.org>2021-10-18 18:22:55 +0300
committerMichael Bestas <mkbestas@lineageos.org>2021-10-18 18:22:55 +0300
commit0e3b56cdb412e1bc868db2e7649fb6978269e196 (patch)
tree8c7a562e32c15349815e6720076a12922f0d89dd /mm/huge_memory.c
parentdea2d7ed9189653c985767477470773f6735be69 (diff)
parentbf687da3fdbe378ae33b7d4c6cbaa2dfa3993628 (diff)
Merge remote-tracking branch 'common/android-4.4-p' into lineage-18.1-caf-msm8998
# By Eric Dumazet (2) and others # Via Greg Kroah-Hartman * common/android-4.4-p: Linux 4.4.289 perf/x86: Reset destroy callback on event init failure scsi: virtio_scsi: Fix spelling mistake "Unsupport" -> "Unsupported" scsi: ses: Fix unsigned comparison with less than zero mac80211: Drop frames from invalid MAC address in ad-hoc mode netfilter: ip6_tables: zero-initialize fragment offset HID: apple: Fix logical maximum and usage maximum of Magic Keyboard JIS mm: check VMA flags to avoid invalid PROT_NONE NUMA balancing gup: document and work around "COW can break either way" issue i40e: fix endless loop under rtnl netlink: annotate data races around nlk->bound ARM: imx6: disable the GIC CPU interface before calling stby-poweroff sequence ptp_pch: Load module automatically if ID matches net_sched: fix NULL deref in fifo_set_limit() phy: mdio: fix memory leak xtensa: call irqchip_init only when CONFIG_USE_OF is selected nfsd4: Handle the NFSv4 READDIR 'dircount' hint being zero USB: cdc-acm: fix break reporting USB: cdc-acm: fix racy tty buffer accesses Change-Id: I72428b366b3ed4931d8f8e8b38c7842ed48ead22
Diffstat (limited to 'mm/huge_memory.c')
-rw-r--r--mm/huge_memory.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 8e035439ec2c..f7c63bd6506e 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -1267,13 +1267,12 @@ out_unlock:
}
/*
- * FOLL_FORCE can write to even unwritable pmd's, but only
- * after we've gone through a COW cycle and they are dirty.
+ * FOLL_FORCE or a forced COW break can write even to unwritable pmd's,
+ * but only after we've gone through a COW cycle and they are dirty.
*/
static inline bool can_follow_write_pmd(pmd_t pmd, unsigned int flags)
{
- return pmd_write(pmd) ||
- ((flags & FOLL_FORCE) && (flags & FOLL_COW) && pmd_dirty(pmd));
+ return pmd_write(pmd) || ((flags & FOLL_COW) && pmd_dirty(pmd));
}
struct page *follow_trans_huge_pmd(struct vm_area_struct *vma,
@@ -1340,9 +1339,6 @@ int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vma,
bool was_writable;
int flags = 0;
- /* A PROT_NONE fault should not end up here */
- BUG_ON(!(vma->vm_flags & (VM_READ | VM_EXEC | VM_WRITE)));
-
ptl = pmd_lock(mm, pmdp);
if (unlikely(!pmd_same(pmd, *pmdp)))
goto out_unlock;