From: Shuai Xue xueshuai@linux.alibaba.com
maillist inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9GCZS CVE: NA
Reference: https://lore.kernel.org/lkml/20240204080144.7977-3-xueshuai@linux.alibaba.co...
--------------------------------
Part of return value comments for memory_failure() were originally documented at the call site. Move those comments to the function declaration to improve code readability and to provide developers with immediate access to function usage and return information.
Signed-off-by: Shuai Xue xueshuai@linux.alibaba.com
conflicts: arch/x86/kernel/cpu/mce/core.c
Signed-off-by: Tong Tiangen tongtiangen@huawei.com --- arch/x86/kernel/cpu/mce/core.c | 7 ------- mm/memory-failure.c | 9 ++++++--- 2 files changed, 6 insertions(+), 10 deletions(-)
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c index 211f83fbcb1b..ea56b6406e0b 100644 --- a/arch/x86/kernel/cpu/mce/core.c +++ b/arch/x86/kernel/cpu/mce/core.c @@ -1353,13 +1353,6 @@ static void kill_me_maybe(struct callback_head *cb) return; }
- /* - * -EHWPOISON from memory_failure() means that it already sent SIGBUS - * to the current process with the proper error info, - * -EOPNOTSUPP means hwpoison_filter() filtered the error event, - * - * In both cases, no further processing is required. - */ if (ret == -EHWPOISON || ret == -EOPNOTSUPP) return;
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index c9372bae3524..40f6b4d540b2 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -2171,9 +2171,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, * Must run in process context (e.g. a work queue) with interrupts * enabled and no spinlocks held. * - * Return: 0 for successfully handled the memory error, - * -EOPNOTSUPP for hwpoison_filter() filtered the error event, - * < 0(except -EOPNOTSUPP) on failure. + * Return values: + * 0 - success + * -EOPNOTSUPP - hwpoison_filter() filtered the error event. + * -EHWPOISON - sent SIGBUS to the current process with the proper + * error info by kill_accessing_process(). + * other negative values - failure */ int memory_failure(unsigned long pfn, int flags) {