All of lore.kernel.org
 help / color / mirror / Atom feed
* + mm-madvise-pass-return-code-of-memory_failure-to-userspace.patch added to -mm tree
@ 2016-01-26 23:28 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2016-01-26 23:28 UTC (permalink / raw)
  To: n-horiguchi, gong.chen, mm-commits


The patch titled
     Subject: mm/madvise: pass return code of memory_failure() to userspace
has been added to the -mm tree.  Its filename is
     mm-madvise-pass-return-code-of-memory_failure-to-userspace.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-madvise-pass-return-code-of-memory_failure-to-userspace.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-madvise-pass-return-code-of-memory_failure-to-userspace.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Subject: mm/madvise: pass return code of memory_failure() to userspace

Currently the return value of memory_failure() is not passed to userspace
when madvise(MADV_HWPOISON) is used.  This 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 the MADV_SOFT_OFFLINE case.

Signed-off-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Chen Gong <gong.chen@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/madvise.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff -puN mm/madvise.c~mm-madvise-pass-return-code-of-memory_failure-to-userspace mm/madvise.c
--- a/mm/madvise.c~mm-madvise-pass-return-code-of-memory_failure-to-userspace
+++ a/mm/madvise.c
@@ -555,8 +555,9 @@ static int madvise_hwpoison(int bhv, uns
 		}
 		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;
 }
_

Patches currently in -mm which might be from n-horiguchi@ah.jp.nec.com are

mm-madvise-pass-return-code-of-memory_failure-to-userspace.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-01-26 23:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-26 23:28 + mm-madvise-pass-return-code-of-memory_failure-to-userspace.patch added to -mm tree akpm

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.