Currently rpc_inline_rcv_pages() uses au_rslack to estimate the size of the upper layer reply header. This is fine for auth flavors where au_verfsize == au_rslack. However, some auth flavors have more going on. krb5i for example has two more words after the verifier, and another blob following the RPC message. The calculation involving au_rslack pushes the upper layer reply header too far into the rcv_buf. au_rslack is still valuable: it's the amount of buffer space needed for the reply, and is used when allocating the reply buffer. We'll keep that. But, add a new field that can be used to properly estimate the location of the upper layer header in each RPC reply, based on the auth flavor in use.
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -74,13 +74,12 @@ struct rpc_cred_cache; · 73 unmodified lines | |||
| 74 | struct rpc_authops; | 74 | struct rpc_authops; |
| 75 | struct rpc_auth { | 75 | struct rpc_auth { |
| 76 | unsigned int au_cslack; /* call cred size estimate */ | 76 | unsigned int au_cslack; /* call cred size estimate */ |
| 77 | /* guess at number of u32's auth adds before | 77 | unsigned int au_rslack; /* reply cred size estimate */ |
| 78 | * reply data; normally the verifier size: */ | ||
| 79 | unsigned int au_rslack; | ||
| 80 | unsigned int au_verfsize; /* size of reply verifier */ | 78 | unsigned int au_verfsize; /* size of reply verifier */ |
| 79 | unsigned int au_ralign; /* words before UL header */ | ||
| 81 | 80 | ||
| 82 | unsigned int au_flags; /* various flags */ | 81 | unsigned int au_flags; |
| 83 | const struct rpc_authops *au_ops; /* operations */ | 82 | const struct rpc_authops *au_ops; |
| 84 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may | 83 | rpc_authflavor_t au_flavor; /* pseudoflavor (note may |
| 85 | * differ from the flavor in | 84 | * differ from the flavor in |
| 86 | * au_ops->au_flavor in gss | 85 | * au_ops->au_flavor in gss |