- include/asm-generic/pgtable.h | 31 +++++++++++++++++++++++--------
- 1 file changed, 23 insertions(+), 8 deletions(-)
-
-diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
-index 34c7bdc..38a7437 100644
---- a/include/asm-generic/pgtable.h
-+++ b/include/asm-generic/pgtable.h
-@@ -680,24 +680,35 @@ static inline int pmd_numa(pmd_t pmd)
- #ifndef pte_mknonnuma
- static inline pte_t pte_mknonnuma(pte_t pte)
- {
-- pte = pte_clear_flags(pte, _PAGE_NUMA);
-- return pte_set_flags(pte, _PAGE_PRESENT|_PAGE_ACCESSED);
-+ pteval_t val = pte_val(pte);
-+
-+ val &= ~_PAGE_NUMA;
-+ val |= (_PAGE_PRESENT|_PAGE_ACCESSED);
-+ return __pte(val);
- }
- #endif
-
- #ifndef pmd_mknonnuma
- static inline pmd_t pmd_mknonnuma(pmd_t pmd)
- {
-- pmd = pmd_clear_flags(pmd, _PAGE_NUMA);
-- return pmd_set_flags(pmd, _PAGE_PRESENT|_PAGE_ACCESSED);
-+ pmdval_t val = pmd_val(pmd);
-+
-+ val &= ~_PAGE_NUMA;
-+ val |= (_PAGE_PRESENT|_PAGE_ACCESSED);
-+
-+ return __pmd(val);
- }
- #endif
-
- #ifndef pte_mknuma
- static inline pte_t pte_mknuma(pte_t pte)
- {
-- pte = pte_set_flags(pte, _PAGE_NUMA);
-- return pte_clear_flags(pte, _PAGE_PRESENT);
-+ pteval_t val = pte_val(pte);
-+
-+ val &= ~_PAGE_PRESENT;
-+ val |= _PAGE_NUMA;
-+
-+ return __pte(val);
- }
- #endif
-
-@@ -716,8 +727,12 @@ static inline void ptep_set_numa(struct mm_struct *mm, unsigned long addr,
- #ifndef pmd_mknuma
- static inline pmd_t pmd_mknuma(pmd_t pmd)
- {
-- pmd = pmd_set_flags(pmd, _PAGE_NUMA);
-- return pmd_clear_flags(pmd, _PAGE_PRESENT);
-+ pmdval_t val = pmd_val(pmd);
-+
-+ val &= ~_PAGE_PRESENT;
-+ val |= _PAGE_NUMA;
-+
-+ return __pmd(val);
- }
- #endif
-
---
-1.8.4.5
-
---
-To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
-the body of a message to majordomo@vger.kernel.org
-More majordomo info at http://vger.kernel.org/majordomo-info.html
-Please read the FAQ at http://www.tux.org/lkml/
-From 1e2ee49f7f1b79f0b14884fe6a602f0411b39552 Mon Sep 17 00:00:00 2001
-From: Will Woods <wwoods@redhat.com>
-Date: Tue, 6 May 2014 12:50:10 -0700
-Subject: fanotify: fix -EOVERFLOW with large files on 64-bit
-
-On 64-bit systems, O_LARGEFILE is automatically added to flags inside
-the open() syscall (also openat(), blkdev_open(), etc). Userspace
-therefore defines O_LARGEFILE to be 0 - you can use it, but it's a
-no-op. Everything should be O_LARGEFILE by default.
-
-But: when fanotify does create_fd() it uses dentry_open(), which skips
-all that. And userspace can't set O_LARGEFILE in fanotify_init()
-because it's defined to 0. So if fanotify gets an event regarding a
-large file, the read() will just fail with -EOVERFLOW.
-
-This patch adds O_LARGEFILE to fanotify_init()'s event_f_flags on 64-bit
-systems, using the same test as open()/openat()/etc.
-
-Addresses https://bugzilla.redhat.com/show_bug.cgi?id=696821
-
-Signed-off-by: Will Woods <wwoods@redhat.com>
-Acked-by: Eric Paris <eparis@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>
-
-diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
-index 4e565c8..732648b 100644
---- a/fs/notify/fanotify/fanotify_user.c
-+++ b/fs/notify/fanotify/fanotify_user.c
-@@ -698,6 +698,8 @@ SYSCALL_DEFINE2(fanotify_init, unsigned int, flags, unsigned int, event_f_flags)