linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Torvalds <torvalds@linux-foundation.org>
To: David Howells <dhowells@redhat.com>
Cc: akpm@linux-foundation.org, jmorris@namei.org,
	shirishpargaonkar@gmail.com, keyrings@linux-nfs.org,
	linux-nfs@vger.kernel.org, linux-cifs@vger.kernel.org,
	Eric Paris <eparis@redhat.com>
Subject: Re: [PATCH] KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring
Date: Thu, 16 Jun 2011 17:26:21 -0700	[thread overview]
Message-ID: <BANLkTimxJ5kHOODSPqRPcgbObjZbfT59uw@mail.gmail.com> (raw)
In-Reply-To: <20110616235600.14345.16839.stgit@warthog.procyon.org.uk>

On Thu, Jun 16, 2011 at 4:56 PM, David Howells <dhowells@redhat.com> wrote:
> ____call_usermodehelper() now erases any credentials set by the
> subprocess_inf::init() function.  The problem is that:

I absolutely puke looking at this patch.  It makes me want to dig out
my eyes with a spoon.

Yes, we had that nasty "umh" TLA before too, but it was mostly hidden
and private and kept a fairly low profile (ie only in that
wait-related enum). This makes it _truly_ barf-worthy by combining it
with a couple of new ugly function typedefs.

There really isn't any prize for the ugliest infrastructure ever.
Please just remove the pointless and ugly typedefs that are used in
just a couple of places. And in most of those cases it just makes the
code actually less readable (ie it's now totally impossible to see
what the type for the passed-in function pointers are, because it's
hidden behind that opaque type.

The only real reason to use typedefs in the kernel is if you really
have *different* types behind them, and explicitly want to make the
type more opaque. Yeah, we've occasionally broken that rule, but it's
almost always been a mistake when we do.

                                 Linus

PS. Possibly it might make more sense to just put the "struct cred *"
pointer into the "struct subprocess_info" and not change any of the
function prototypes at all?

  reply	other threads:[~2011-06-17  0:26 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-16 23:56 [PATCH] KEYS/DNS: Fix ____call_usermodehelper() to not lose the session keyring David Howells
2011-06-17  0:26 ` Linus Torvalds [this message]
2011-06-17  9:56 ` David Howells

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=BANLkTimxJ5kHOODSPqRPcgbObjZbfT59uw@mail.gmail.com \
    --to=torvalds@linux-foundation.org \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=eparis@redhat.com \
    --cc=jmorris@namei.org \
    --cc=keyrings@linux-nfs.org \
    --cc=linux-cifs@vger.kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=shirishpargaonkar@gmail.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;
as well as URLs for NNTP newsgroup(s).