From: Jarkko Sakkinen <jarkko@kernel.org> To: David Howells <dhowells@redhat.com>, mchehab+huawei@kernel.org Cc: selinux@vger.kernel.org, linux-api@vger.kernel.org, containers@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, keyrings@vger.kernel.org, sprabhu@redhat.com, linux-fsdevel@vger.kernel.org, christian@brauner.io Subject: Re: [PATCH 1/2] Add namespace tags that can be used for matching without pinning a ns Date: Mon, 8 Feb 2021 01:55:49 +0200 [thread overview] Message-ID: <YCB+BRp7WIa8YoO3@kernel.org> (raw) In-Reply-To: <2094924.1612513535@warthog.procyon.org.uk> On Fri, Feb 05, 2021 at 08:25:35AM +0000, David Howells wrote: > Jarkko Sakkinen <jarkko@kernel.org> wrote: > > > > + * init_ns_common - Initialise the common part of a namespace > > > > Nit: init_ns_common() > > Interesting. The majority of code doesn't put the brackets in. > > > I've used lately (e.g. arch/x86/kernel/cpu/sgx/ioctl.c) along the lines: > > > > * Return: > > * - 0: Initialization was successful. > > * - -ENOMEM: Out of memory. > > Actually, looking at kernel-doc.rst, this isn't necessarily the recommended > approach as it will much everything into one line, complete with dashes, and > can't handle splitting over lines. You probably meant: > > * Return: > * * 0 - OK to runtime suspend the device > * * -EBUSY - Device should not be runtime suspended A line beginning with dash, lines up just as well, as one beginning with an asterisk. I've also tested this with "make htmldocs". This is Mauro's response to my recent patch: https://lore.kernel.org/lkml/20210125105353.5c695d42@coco.lan/ So, what I can make up from this is that they are equally good alternatives. What I'm not still fully registering is the dash after the return value. I mean double comma is used after parameter. Why this weird dash syntax is used after return value I have no idea, and the kernel-doc.rst does not provide any explanation. > > > * Return: > > * - 0: Initialization was successful. > > * - -ENOMEM: Out of memory. > > > > Looking at the implementation, I guess this is a complete representation of > > what it can return? > > It isn't. It can return at least -ENOSPC as well, but it's awkward detailing > the errors from functions it calls since they can change and then the > description here is wrong. I'm not sure there's a perfect answer to that. > > David What if you just add this as the last entry: * * -errno: Otherwise. /Jarkko _______________________________________________ Containers mailing list Containers@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/containers
WARNING: multiple messages have this Message-ID (diff)
From: Jarkko Sakkinen <jarkko@kernel.org> To: David Howells <dhowells@redhat.com>, mchehab+huawei@kernel.org Cc: sprabhu@redhat.com, christian@brauner.io, selinux@vger.kernel.org, keyrings@vger.kernel.org, linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, linux-kernel@vger.kernel.org, containers@lists.linux-foundation.org Subject: Re: [PATCH 1/2] Add namespace tags that can be used for matching without pinning a ns Date: Mon, 8 Feb 2021 01:55:49 +0200 [thread overview] Message-ID: <YCB+BRp7WIa8YoO3@kernel.org> (raw) In-Reply-To: <2094924.1612513535@warthog.procyon.org.uk> On Fri, Feb 05, 2021 at 08:25:35AM +0000, David Howells wrote: > Jarkko Sakkinen <jarkko@kernel.org> wrote: > > > > + * init_ns_common - Initialise the common part of a namespace > > > > Nit: init_ns_common() > > Interesting. The majority of code doesn't put the brackets in. > > > I've used lately (e.g. arch/x86/kernel/cpu/sgx/ioctl.c) along the lines: > > > > * Return: > > * - 0: Initialization was successful. > > * - -ENOMEM: Out of memory. > > Actually, looking at kernel-doc.rst, this isn't necessarily the recommended > approach as it will much everything into one line, complete with dashes, and > can't handle splitting over lines. You probably meant: > > * Return: > * * 0 - OK to runtime suspend the device > * * -EBUSY - Device should not be runtime suspended A line beginning with dash, lines up just as well, as one beginning with an asterisk. I've also tested this with "make htmldocs". This is Mauro's response to my recent patch: https://lore.kernel.org/lkml/20210125105353.5c695d42@coco.lan/ So, what I can make up from this is that they are equally good alternatives. What I'm not still fully registering is the dash after the return value. I mean double comma is used after parameter. Why this weird dash syntax is used after return value I have no idea, and the kernel-doc.rst does not provide any explanation. > > > * Return: > > * - 0: Initialization was successful. > > * - -ENOMEM: Out of memory. > > > > Looking at the implementation, I guess this is a complete representation of > > what it can return? > > It isn't. It can return at least -ENOSPC as well, but it's awkward detailing > the errors from functions it calls since they can change and then the > description here is wrong. I'm not sure there's a perfect answer to that. > > David What if you just add this as the last entry: * * -errno: Otherwise. /Jarkko
next prev parent reply other threads:[~2021-02-07 23:56 UTC|newest] Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-02-04 17:47 [RFC][PATCH 0/2] keys: request_key() interception in containers David Howells 2021-02-04 17:47 ` David Howells 2021-02-04 17:47 ` [PATCH 1/2] Add namespace tags that can be used for matching without pinning a ns David Howells 2021-02-04 17:47 ` David Howells 2021-02-04 20:14 ` kernel test robot 2021-02-04 20:14 ` kernel test robot 2021-02-04 20:58 ` kernel test robot 2021-02-04 20:58 ` kernel test robot 2021-02-05 2:46 ` Jarkko Sakkinen 2021-02-05 2:46 ` Jarkko Sakkinen 2021-02-05 8:25 ` David Howells 2021-02-05 8:25 ` David Howells 2021-02-07 23:55 ` Jarkko Sakkinen [this message] 2021-02-07 23:55 ` Jarkko Sakkinen 2021-02-04 17:47 ` [PATCH 2/2] keys: Allow request_key upcalls from a container to be intercepted David Howells 2021-02-04 17:47 ` David Howells 2021-02-04 19:55 ` kernel test robot 2021-02-04 19:55 ` kernel test robot
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=YCB+BRp7WIa8YoO3@kernel.org \ --to=jarkko@kernel.org \ --cc=christian@brauner.io \ --cc=containers@lists.linux-foundation.org \ --cc=dhowells@redhat.com \ --cc=keyrings@vger.kernel.org \ --cc=linux-api@vger.kernel.org \ --cc=linux-fsdevel@vger.kernel.org \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-security-module@vger.kernel.org \ --cc=mchehab+huawei@kernel.org \ --cc=selinux@vger.kernel.org \ --cc=sprabhu@redhat.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: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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.