[OpenAFS-devel] keyring/pag support for linux

Derrick J Brashear shadow@dementia.org
Wed, 2 Aug 2006 10:19:39 -0400 (EDT)


On Wed, 2 Aug 2006, David Howells wrote:

> chas williams - CONTRACTOR <chas@cmf.nrl.navy.mil> wrote:
>
>> and yet another version.  this time, you dont (or shouldnt) need changes
>> to your local kernel tree.  we have our own version of join_session_keyring()
>> which uses the public bits of the keyring api and a bit of information from
>> task 1 to allocate and link a new session keyring.
>
> I like your ingenuity:-)
>
>> what we really need from the linux kernel: the keyring key_type exported,
>
> Whilst I could do that, I'm not sure it'd help you as you'd need to use the
> RCU interface to access keyrings directly.

We'll come back to that.

>> the keyring primitives exported,
>
> That should be possible for the most part.  Which ones were you thinking of?
>
>> or join_session_keyring() exported.
>
> That should be possible.
>
> You could also use something like:
>
> 	#include <asm/unistd.h>
>
> 	static inline _syscall2(long, keyctl, int, option, void*, arg2)
>
> 	long serial = keyctl(KEYCTL_JOIN_SESSION_KEYRING, NULL);

Is keyctl() exported in the kernel now? Otherwise, this won't work for us.

> The first is a definite no-go if you can't use RCU - you could cause other
> parts of the kernel to oops.

Well, we need to pursue that otherwise.

> Another alternative might be to try putting the PAG stuff in the main kernel,
> and add a keyctl function to set or get a pag.

That would be fine, I suspect, since NFS v4 would probably also use it. 
Kevin?

> The main thing I'm not sure about how to do is to change the PAG to which a
> process's parent subscribes.  It is possible, but the locking is interesting.

Don't. When a child changes a PAG, it's the child and its' children get 
the new one, and the parent is left alone.

Derrick