From: Joe Lawrence <joe.lawrence@redhat.com>
To: Alice Ferrazzi <alicef@alicef.me>
Cc: jpoimboe@redhat.com, jeyu@kernel.org, jikos@kernel.org,
mbenes@suse.cz, pmladek@suse.com, live-patching@vger.kernel.org,
linux-kernel@vger.kernel.org,
Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
Subject: Re: [PATCH] livepatch: core: Return ENOTSUPP instead of ENOSYS
Date: Mon, 28 Jan 2019 14:49:43 -0500 [thread overview]
Message-ID: <20190128194943.GA18515@redhat.com> (raw)
In-Reply-To: <20190126192630.6163-1-alicef@alicef.me>
On Sun, Jan 27, 2019 at 04:26:30AM +0900, Alice Ferrazzi wrote:
> This patch fixes a checkpatch warning:
> WARNING: ENOSYS means 'invalid syscall nr' and nothing else
>
> Signed-off-by: Alice Ferrazzi <alice.ferrazzi@miraclelinux.com>
> ---
> kernel/livepatch/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/kernel/livepatch/core.c b/kernel/livepatch/core.c
> index 5b77a7314e01..eea6b94fef89 100644
> --- a/kernel/livepatch/core.c
> +++ b/kernel/livepatch/core.c
> @@ -897,7 +897,7 @@ int klp_register_patch(struct klp_patch *patch)
>
> if (!klp_have_reliable_stack()) {
> pr_err("This architecture doesn't have support for the livepatch consistency model.\n");
> - return -ENOSYS;
> + return -ENOTSUPP;
> }
>
> return klp_init_patch(patch);
> --
> 2.19.2
>
Hi Alice,
Patches should be based off the upstream livepatching tree, found here:
git://git.kernel.org/pub/scm/linux/kernel/git/livepatching/livepatching.git
and in this case, the for-next branch, which holds patches that have
already been queued up for the next release. This one:
958ef1e39d24 ("livepatch: Simplify API by removing registration step")
has moved the code in question from klp_register_patch() to
klp_enable_patch().
As far as the change itself, I don't have strong opinion about it
either way.
On the one hand, there is the checkpatch warning and -ENOTSUPP reads
more intuitively than -ENOSYS.
However, the current pattern seems to be more prevelent in the kernel.
I wonder if the checkpatch warning would be better specified for return
values that are actually passed back to userspace.
Also, klp_register_patch(), now klp_enable_patch(), is exported for
module use, though I don't believe anyone (samples / tests / kpatch /
kgraft?) is inspecting which error value is returned.
I would defer to whichever convention the maintainers prefer here.
-- Joe
next prev parent reply other threads:[~2019-01-28 19:49 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-26 19:26 Alice Ferrazzi
2019-01-28 19:49 ` Joe Lawrence [this message]
2019-01-29 16:50 ` Josh Poimboeuf
2019-01-30 12:41 ` Petr Mladek
2019-01-30 13:00 ` alicef
2019-01-30 13:10 ` Josh Poimboeuf
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=20190128194943.GA18515@redhat.com \
--to=joe.lawrence@redhat.com \
--cc=alice.ferrazzi@miraclelinux.com \
--cc=alicef@alicef.me \
--cc=jeyu@kernel.org \
--cc=jikos@kernel.org \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=live-patching@vger.kernel.org \
--cc=mbenes@suse.cz \
--cc=pmladek@suse.com \
/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
Powered by JetHome