Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1314827
| From | Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace |
| Date | 2016-01-22 09:30 +0100 |
| Message-ID | <qTFgu-1rB-11@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Currently the return value of memory_failure() is not passed to userspace, which
is inconvenient for test programs that want to know the result of error handling.
So let's return it to the caller as we already do in MADV_SOFT_OFFLINE case.
Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
---
mm/madvise.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git v4.4-mmotm-2016-01-20-16-10/mm/madvise.c v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
index f56825b..6a77114 100644
--- v4.4-mmotm-2016-01-20-16-10/mm/madvise.c
+++ v4.4-mmotm-2016-01-20-16-10_patched/mm/madvise.c
@@ -555,8 +555,9 @@ static int madvise_hwpoison(int bhv, unsigned long start, unsigned long end)
}
pr_info("Injecting memory failure for page %#lx at %#lx\n",
page_to_pfn(p), start);
- /* Ignore return value for now */
- memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
+ ret = memory_failure(page_to_pfn(p), 0, MF_COUNT_INCREASED);
+ if (ret)
+ return ret;
}
return 0;
}
--
2.7.0
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
[PATCH v1] mm/madvise: pass return code of memory_failure() to userspace Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-01-22 09:30 +0100
Re: [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace Andrew Morton <akpm@linux-foundation.org> - 2016-01-27 00:30 +0100
Re: [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace Naoya Horiguchi <n-horiguchi@ah.jp.nec.com> - 2016-01-27 02:30 +0100
Re: [PATCH v1] mm/madvise: pass return code of memory_failure() to userspace Vlastimil Babka <vbabka@suse.cz> - 2016-01-27 15:00 +0100
csiph-web