lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <D4B2WNJCNUZG.2LF50Q197L6AN@kernel.org>
Date: Fri, 20 Sep 2024 14:35:44 +0300
From: "Jarkko Sakkinen" <jarkko@...nel.org>
To: "Shuai Xue" <xueshuai@...ux.alibaba.com>, <mark.rutland@....com>,
 <catalin.marinas@....com>, <mingo@...hat.com>, <robin.murphy@....com>,
 <Jonathan.Cameron@...wei.com>, <bp@...en8.de>, <rafael@...nel.org>,
 <wangkefeng.wang@...wei.com>, <tanxiaofei@...wei.com>,
 <mawupeng1@...wei.com>, <tony.luck@...el.com>, <linmiaohe@...wei.com>,
 <naoya.horiguchi@....com>, <james.morse@....com>, <tongtiangen@...wei.com>,
 <gregkh@...uxfoundation.org>, <will@...nel.org>
Cc: <linux-acpi@...r.kernel.org>, <linux-mm@...ck.org>,
 <linux-kernel@...r.kernel.org>, <akpm@...ux-foundation.org>,
 <linux-edac@...r.kernel.org>, <x86@...nel.org>, <justin.he@....com>,
 <ardb@...nel.org>, <ying.huang@...el.com>, <ashish.kalra@....com>,
 <baolin.wang@...ux.alibaba.com>, <tglx@...utronix.de>,
 <dave.hansen@...ux.intel.com>, <lenb@...nel.org>, <hpa@...or.com>,
 <robert.moore@...el.com>, <lvying6@...wei.com>, <xiexiuqi@...wei.com>,
 <zhuo.song@...ux.alibaba.com>
Subject: Re: [PATCH v13 2/3] mm: memory-failure: move return value
 documentation to function declaration

On Fri Sep 20, 2024 at 7:30 AM EEST, Shuai Xue wrote:
> 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@...ux.alibaba.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 2a938f429c4d..c90d8fcd246a 100644
> --- a/arch/x86/kernel/cpu/mce/core.c
> +++ b/arch/x86/kernel/cpu/mce/core.c
> @@ -1373,13 +1373,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 7066fc84f351..7984e0d99d09 100644
> --- a/mm/memory-failure.c
> +++ b/mm/memory-failure.c
> @@ -2199,9 +2199,12 @@ static void kill_procs_now(struct page *p, 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:
> + *   0             - success,
> + *   -EOPNOTSUPP   - hwpoison_filter() filtered the error event,
> + *   -EHWPOISON    - the page was already poisoned, potentially
> + *                   kill process,
> + *   other negative values - failure.
>   */
>  int memory_failure(unsigned long pfn, int flags)
>  {

Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ