summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephen Rothwell <sfr@canb.auug.org.au>2011-02-21 17:33:45 +1100
committerStephen Rothwell <sfr@canb.auug.org.au>2011-02-21 17:33:45 +1100
commit97d34f4ce8d3c9f280aeffbd93326aae7c1e52f3 (patch)
tree4089de5a1bbcfa5273aa93ae1cccd859c344e063
parentd939e44b8fdcbccb9d214d81aeeae15cbb43e313 (diff)
Revert "mm: make __get_user_pages return -EHWPOISON for HWPOISON page optionally"
This reverts commit b1c4f2836370f5c8207d4c61e91c93bd6a4ce27a.
-rw-r--r--include/asm-generic/errno.h2
-rw-r--r--include/linux/mm.h1
-rw-r--r--mm/memory.c13
3 files changed, 3 insertions, 13 deletions
diff --git a/include/asm-generic/errno.h b/include/asm-generic/errno.h
index a1331ce50445..28cc03bf19e6 100644
--- a/include/asm-generic/errno.h
+++ b/include/asm-generic/errno.h
@@ -108,6 +108,4 @@
#define ERFKILL 132 /* Operation not possible due to RF-kill */
-#define EHWPOISON 133 /* Memory page has hardware error */
-
#endif
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 0be49febd8b2..5752f544e41f 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -1534,7 +1534,6 @@ struct page *follow_page(struct vm_area_struct *, unsigned long address,
#define FOLL_FORCE 0x10 /* get_user_pages read/write w/o permission */
#define FOLL_MLOCK 0x40 /* mark page as mlocked */
#define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */
-#define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */
typedef int (*pte_fn_t)(pte_t *pte, pgtable_t token, unsigned long addr,
void *data);
diff --git a/mm/memory.c b/mm/memory.c
index d31ca1e9b103..471f3aad5e64 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1576,16 +1576,9 @@ int __get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
if (ret & VM_FAULT_ERROR) {
if (ret & VM_FAULT_OOM)
return i ? i : -ENOMEM;
- if (ret & (VM_FAULT_HWPOISON |
- VM_FAULT_HWPOISON_LARGE)) {
- if (i)
- return i;
- else if (gup_flags & FOLL_HWPOISON)
- return -EHWPOISON;
- else
- return -EFAULT;
- }
- if (ret & VM_FAULT_SIGBUS)
+ if (ret &
+ (VM_FAULT_HWPOISON|VM_FAULT_HWPOISON_LARGE|
+ VM_FAULT_SIGBUS))
return i ? i : -EFAULT;
BUG();
}