[OpenAFS-devel] Re: Proposed new kafs interface: k_getpag

Thomas Kula kula@tproa.net
Thu, 16 Jul 2009 16:51:39 -0400


On Thu, Jul 16, 2009 at 08:27:17AM -0700, Russ Allbery wrote:
> Love H?rnquist ?strand <lha@kth.se> writes:
> 
> > I don't see any problems, however, I want to ask a question.
> >
> > That do you plan to do with the value you get back ? From your problem
> > description this api would also solve your problem description.
> >
> > int     k_haspag(void); /* k_isinpag()  ? */
> 
> That's a good point, and I was pondering whether that would be a better
> approach.  The only advantage to returning the actual PAG number that I
> can think of is that it allows one to remember it and later determine
> whether one is still in the same PAG, but off the top of my head I can't
> think of a case when I'd want to do that.
> 

The first thing that pops into my head is "aid in debugging". There have
been several times where I've had related processes that should be in
the same pag and have the same credentials not be, and with some of the
weirdness we've encountered it would be nice to have the actual pag
number so I could say "yes, both things are in the same pag[1], something
else is going on" or "no, they are not in the same pag, find out what
caused that".

And as someone else has pointed out, I'm sure someone will think of
some reason to want the number. Why not have the interface return
the number?

[1]: And not have to try to figure out the pag number by "oh, hey, are 
     PAG numbers stored in the group list on this machine, or in a
     keychain, or some other identifier we have yet to invent...."



-- 
Thomas L. Kula | kula@tproa.net | http://kula.tproa.net/