From: Frank Sorenson <sorenson@redhat.com>
To: Trond Myklebust <trondmy@primarydata.com>
Cc: List Linux NFS Mailing <linux-nfs@vger.kernel.org>
Subject: Re: [PATCH] sunrpc: include gid in the rpc_cred_cache hash
Date: Mon, 19 Sep 2016 09:10:50 -0400 (EDT) [thread overview]
Message-ID: <1272446089.121606.1474290650680.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <7EC0B2B1-CE1A-4509-9FE2-A5D6529626DA@primarydata.com>
----- Original Message -----
> From: "Trond Myklebust" <trondmy@primarydata.com>
> To: "Frank Sorenson" <sorenson@redhat.com>
> Cc: "List Linux NFS Mailing" <linux-nfs@vger.kernel.org>
> Sent: Friday, September 16, 2016 4:37:39 PM
> Subject: Re: [PATCH] sunrpc: include gid in the rpc_cred_cache hash
> > +rpcauth_hash_acred(struct auth_cred *acred, unsigned int hashbits)
> > +{
> > + return hash_64(from_kgid(&init_user_ns, acred->gid) |
> > + (from_kuid(&init_user_ns, acred->uid) << (sizeof(gid_t) * 8)),
> > + hashbits);
> > +}
> > +
> NACK. The choice of only using the uid when hashing was deliberate;
> RPCSEC_GSS is keyed only on the uid…
> If you want to do this in order to accelerate AUTH_SYS lookups, then you need
> to push the hashing down to the auth flavour ops.
I recognize that RPCSEC_GSS only uses the uid as a key. However, RPCSEC_GSS
calls rpcauth_lookup_credcache with an auth_cred, just like AUTH_SYS, only with
the gid set to 0. Including the gid in the hash has no effect on RPCSEC_GSS;
if the function is flipped to shift the gid instead of the uid, it even hashes
to the same result as it did previously.
Adding a shift and bitwise OR to the hash is more straightforward and
efficient than adding the logic to provide a per-auth flavour hash op that
differs only in that it doesn't shift and OR a 0 value.
Or are there additional benefits to be gained from each having its own hash
function?
Thanks,
Frank
--
Frank Sorenson
sorenson@redhat.com
Senior Software Maintenance Engineer
Global Support Services - filesystems
Red Hat
next prev parent reply other threads:[~2016-09-19 13:10 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-16 20:12 [PATCH] sunrpc: include gid in the rpc_cred_cache hash Frank Sorenson
2016-09-16 20:42 ` Jeff Layton
2016-09-16 21:10 ` kbuild test robot
2016-09-16 21:37 ` Trond Myklebust
2016-09-19 13:10 ` Frank Sorenson [this message]
2016-09-19 14:49 ` Trond Myklebust
2016-09-19 15:37 ` Frank Sorenson
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=1272446089.121606.1474290650680.JavaMail.zimbra@redhat.com \
--to=sorenson@redhat.com \
--cc=linux-nfs@vger.kernel.org \
--cc=trondmy@primarydata.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 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.