From: David Howells <dhowells@redhat.com>
To: Oleg Nesterov <oleg@redhat.com>
Cc: dhowells@redhat.com, Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
David Smith <dsmith@redhat.com>,
"Frank Ch. Eigler" <fche@redhat.com>,
Larry Woodman <lwoodman@redhat.com>,
Peter Zijlstra <peterz@infradead.org>, Tejun Heo <tj@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] cred: change keyctl_session_to_parent() to use task_work_queue()
Date: Thu, 12 Apr 2012 10:29:55 +0100 [thread overview]
Message-ID: <9202.1334222995@redhat.com> (raw)
In-Reply-To: <20120412024825.GB17984@redhat.com>
Oleg Nesterov <oleg@redhat.com> wrote:
> Change keyctl_session_to_parent() to use task_work_queue() and
> move key_replace_session_keyring() logic into task_work->func().
I'm generally okay with this, but there are a couple of issues with the patch.
> +static void replace_session_keyring(struct task_work *twork)
Can you keep this in process_keys.c please? Then everything that actually
updates a process's keyrings is done there. Admittedly, on that basis, you
can argue that I should move a chunk of keyctl_session_to_parent() there too.
And, also, can you please keep the "key_" on the front of the name?
> long keyctl_session_to_parent(void)
> {
> -#ifdef TIF_NOTIFY_RESUME
Unless TIF_NOTIFY_RESUME is defined, this operation cannot be performed and
should generate an error. I don't see how this happens now.
> + if (!task_work_queue(parent, newwork))
I hate this type of construct. "if not function()" indicating the function
succeeded. Can you make it "== 0" instead? Also, shouldn't we tell the user
that it failed?
David
next prev parent reply other threads:[~2012-04-12 9:30 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-12 2:47 [PATCH v2 0/2] task_work_queue() && keyctl_session_to_parent() Oleg Nesterov
2012-04-12 2:48 ` [PATCH v2 1/2] task_work_queue: add generic process-context callbacks Oleg Nesterov
2012-04-12 4:00 ` hlist_for_each_entry && pos (Was: task_work_queue) Oleg Nesterov
2012-04-12 4:12 ` Linus Torvalds
2012-04-12 4:28 ` Oleg Nesterov
2012-04-12 4:39 ` Linus Torvalds
2012-04-12 5:02 ` Al Viro
2012-04-16 22:35 ` Paul E. McKenney
2012-04-17 20:43 ` Oleg Nesterov
2012-04-12 9:35 ` TIF_NOTIFY_RESUME [was Re: [PATCH v2 1/2] task_work_queue: add generic process-context callbacks] David Howells
2012-04-12 17:41 ` Oleg Nesterov
2012-04-12 2:48 ` [PATCH v2 2/2] cred: change keyctl_session_to_parent() to use task_work_queue() Oleg Nesterov
2012-04-12 9:29 ` David Howells [this message]
2012-04-12 17:34 ` Oleg Nesterov
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=9202.1334222995@redhat.com \
--to=dhowells@redhat.com \
--cc=akpm@linux-foundation.org \
--cc=dsmith@redhat.com \
--cc=fche@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lwoodman@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=tj@kernel.org \
--cc=torvalds@linux-foundation.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