All of lore.kernel.org
 help / color / mirror / Atom feed
* SP4_MACH_CRED: v4 proc -> opcodes mapping
@ 2013-07-18 14:46 Adamson, Dros
  2013-07-18 14:57 ` Myklebust, Trond
  0 siblings, 1 reply; 20+ messages in thread
From: Adamson, Dros @ 2013-07-18 14:46 UTC (permalink / raw)
  To: Myklebust, Trond; +Cc: linux-nfs list

Hey,

I have a mostly functional client-side implementation of SP4_MACH_CRED! It still needs a lot of cleanup and testing.

I have one style issue that I want to run by the list before I post a patchset:

So, SP4_MACH_CRED negotiates two bitmaps in the EXCHANGE_ID (one "enforce", one "allow") for state protection. These bitmaps are indexed by the NFSv4 operation number.  The state protect check must happen in the nfs4proc.c layer (or before), right before we call rpc_call_sync or equivalent, so that it can select the right cred and rpc_client.

Here's the problem: we don't know what operations (opcodes) are actually in a compound until the XDR encode callback is called.  The rpc_procinfo array doesn't have this mapping - in fact, it only lives in the xdr encode layer.

One approach is to immediately translate the opcode bitmaps to "nfs4 procedure index" bitmaps, indexing into the rpc_procinfo array.  This would mean there is a second mapping of NFSv4 procedure -> opcodes that must be updated when an XDR encode callback is changed.

Another approach would be to add a callback to the XDR api so we could "ask" it if an NFSv4 procedure contains any of the opcodes in a bitmap. The nice thing about this approach is that the mapping of procedure to opcodes within will live right next to the XDR encode callback and make it obvious that both need to be changed together.

I suppose I'm leaning toward a combination of both of these approaches - keep the mapping in XDR-land and translate the bitmaps immediately on negation for fast lookups during normal operation.

Comments? Am I missing something?

-dros

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2013-07-19 15:09 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18 14:46 SP4_MACH_CRED: v4 proc -> opcodes mapping Adamson, Dros
2013-07-18 14:57 ` Myklebust, Trond
2013-07-18 15:10   ` Adamson, Dros
2013-07-18 15:21     ` Myklebust, Trond
2013-07-18 15:50       ` Adamson, Dros
2013-07-18 17:08         ` Myklebust, Trond
2013-07-18 18:13           ` Adamson, Dros
2013-07-18 19:49             ` Adamson, Dros
2013-07-18 19:54               ` Myklebust, Trond
2013-07-18 20:04                 ` Adamson, Dros
2013-07-18 20:06                   ` Myklebust, Trond
2013-07-18 20:16                     ` Adamson, Dros
2013-07-18 20:41                       ` Adamson, Dros
2013-07-18 20:48                         ` Myklebust, Trond
2013-07-18 20:49                         ` Myklebust, Trond
2013-07-18 20:56                           ` Myklebust, Trond
2013-07-18 20:36                   ` Myklebust, Trond
2013-07-18 20:04                 ` Should BIND_CONN_TO_SESSION be allowed to return NFS4ERR_WRONG_CRED Myklebust, Trond
2013-07-18 20:24                   ` Myklebust, Trond
2013-07-19 15:09                   ` [nfsv4] " J. Bruce Fields

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.