From: Reinette Chatre <reinette.chatre@intel.com>
To: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>,
Fenghua Yu <fenghua.yu@intel.com>
Cc: Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
<x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86/resctrl: Fix return code in mkdir_rdt_prepare()
Date: Fri, 24 Sep 2021 11:53:29 -0700 [thread overview]
Message-ID: <600c2857-8a5f-df1e-0edc-65fea2aae078@intel.com> (raw)
In-Reply-To: <20210924081713.502039-1-tan.shaopeng@jp.fujitsu.com>
Hi Shaopeng Tan,
On 9/24/2021 1:17 AM, Shaopeng Tan wrote:
> When kzalloc fails, we should return ENOMEM instead of ENOSPC.
>
> Signed-off-by: Shaopeng Tan <tan.shaopeng@jp.fujitsu.com>
> ---
> Hello,
>
> I just noticed this when I read the code.
>
> Thanks,
>
> arch/x86/kernel/cpu/resctrl/rdtgroup.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index b57b3db9a6a7..a92d047476f6 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -2854,7 +2854,7 @@ static int mkdir_rdt_prepare(struct kernfs_node *parent_kn,
> /* allocate the rdtgroup. */
> rdtgrp = kzalloc(sizeof(*rdtgrp), GFP_KERNEL);
> if (!rdtgrp) {
> - ret = -ENOSPC;
> + ret = -ENOMEM;
> rdt_last_cmd_puts("Kernel out of memory\n");
> goto out_unlock;
> }
>
I do not know the original motivation for using ENOSPC but from what I
can tell this error is propagated all the way to user space. This change
thus has the consequence that any interface built on top of resctrl
could be impacted.
Is there a specific issue that you are aiming to fix here?
Reinette
next prev parent reply other threads:[~2021-09-24 18:53 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-24 8:17 Shaopeng Tan
2021-09-24 18:53 ` Reinette Chatre [this message]
2021-09-28 4:44 ` tan.shaopeng
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=600c2857-8a5f-df1e-0edc-65fea2aae078@intel.com \
--to=reinette.chatre@intel.com \
--cc=bp@alien8.de \
--cc=fenghua.yu@intel.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=tan.shaopeng@jp.fujitsu.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®