From: David Howells <dhowells@redhat.com>
To: Trond Myklebust <Trond.Myklebust@netapp.com>
Cc: dhowells@redhat.com, viro@ftp.linux.org.uk, hch@infradead.org,
kwc@citi.umich.edu, jlayton@redhat.com, nickpiggin@yahoo.com.au,
linux-fsdevel@vger.kernel.org
Subject: Re: Caching semi-digested credentials in struct cred
Date: Wed, 24 Oct 2007 19:41:58 +0100 [thread overview]
Message-ID: <3818.1193251318@redhat.com> (raw)
In-Reply-To: <1193248356.7515.7.camel@heimdal.trondhjem.org>
Trond Myklebust <Trond.Myklebust@netapp.com> wrote:
> What is a 'struct key'? Is that a credential?
It can represent one yes.
> NO! Keyrings are meant for communicating with userspace. They should not
> be used as a 'generic cache' in the kernel.
Erm, I'm pretty sure that keys are primarily for caching credentials that the
kernel needs to use a lot, so that it doesn't have to keep asking userspace for
them. Keyrings are a defined method of retaining and searching for keys.
It happens that userspace can also make use of the cached keys, given
appropriate rights.
However, I don't particularly like the idea of a cache as I can see it raising
various problems.
> Why are you trying to replace the rpc_cred?
So that NFS doesn't have to pass both rpc_cred and cred pointers around. I
can't just give struct cred an rpc_cred pointer as it may the former may hold
information on several of the latter (for different NFS domains).
I'm not objecting to the existence of rpc_cred per se, but if it's retained by
struct cred, then it needs to be in some generic mechanism, and rpc_cred's
fields can be mapped more or less onto a key struct.
> Use the credential struct as the unique lookup key for an rpc_cred.
That's not good enough. A cred struct may map to several rpc_creds as I
mentioned above. I suppose the nfs_client struct address could be added to the
lookup key.
Furthermore, a cred struct may end up referring to different rpc_creds for the
same domain if a key in the keyrings changes - unless I add something to make a
COW mirror of the keyring contents from the keyrings.
> If looking up rpc creds is a performance issue, then that needs to be
> addressed separately. It should have nothing to do with the design of a
> generic credential.
If there's a cred -> rpc_cred mapping, then it might make sense to root the
mapping in the cred struct and to make it generic. NFS is just one of the
kernel services that might want to use this.
David
next prev parent reply other threads:[~2007-10-24 18:42 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1193237038.7508.4.camel@heimdal.trondhjem.org>
[not found] ` <1192634425.7573.5.camel@heimdal.trondhjem.org>
[not found] ` <7004.1192630004@redhat.com>
[not found] ` <1248.1193234419@redhat.com>
2007-10-24 17:10 ` Caching semi-digested credentials in struct cred David Howells
2007-10-24 17:52 ` Trond Myklebust
2007-10-24 18:41 ` David Howells [this message]
2007-10-24 19:39 ` Trond Myklebust
2007-10-24 22:22 ` David Howells
2007-10-24 23:09 ` Trond Myklebust
2007-10-25 15:45 ` David Howells
2007-10-25 15:59 ` Trond Myklebust
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=3818.1193251318@redhat.com \
--to=dhowells@redhat.com \
--cc=Trond.Myklebust@netapp.com \
--cc=hch@infradead.org \
--cc=jlayton@redhat.com \
--cc=kwc@citi.umich.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
--cc=viro@ftp.linux.org.uk \
/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).