The patch titled knfsd: svcrpc: gss: factor out some common wrapping code has been added to the -mm tree. Its filename is knfsd-svcrpc-gss-factor-out-some-common-wrapping-code.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: knfsd: svcrpc: gss: factor out some common wrapping code From: J.Bruce Fields <bfields@xxxxxxxxxxxx> Factor out some common code from the integrity and privacy cases. Signed-off-by: J. Bruce Fields <bfields@xxxxxxxxxxxxxx> Signed-off-by: Neil Brown <neilb@xxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- net/sunrpc/auth_gss/svcauth_gss.c | 43 ++++++++++++++-------------- 1 files changed, 23 insertions(+), 20 deletions(-) diff -puN net/sunrpc/auth_gss/svcauth_gss.c~knfsd-svcrpc-gss-factor-out-some-common-wrapping-code net/sunrpc/auth_gss/svcauth_gss.c --- a/net/sunrpc/auth_gss/svcauth_gss.c~knfsd-svcrpc-gss-factor-out-some-common-wrapping-code +++ a/net/sunrpc/auth_gss/svcauth_gss.c @@ -1147,6 +1147,25 @@ out: return ret; } +u32 * +svcauth_gss_prepare_to_wrap(struct xdr_buf *resbuf, struct gss_svc_data *gsd) +{ + u32 *p; + + p = gsd->body_start; + gsd->body_start = NULL; + /* move accept_stat to right place: */ + memcpy(p, p + 2, 4); + /* Don't wrap in failure case: */ + /* Counting on not getting here if call was not even accepted! */ + if (*p != rpc_success) { + resbuf->head[0].iov_len -= 2 * 4; + return NULL; + } + p++; + return p; +} + static inline int svcauth_gss_wrap_resp_integ(struct svc_rqst *rqstp) { @@ -1160,17 +1179,9 @@ svcauth_gss_wrap_resp_integ(struct svc_r int integ_offset, integ_len; int stat = -EINVAL; - p = gsd->body_start; - gsd->body_start = NULL; - /* move accept_stat to right place: */ - memcpy(p, p + 2, 4); - /* Don't wrap in failure case: */ - /* Counting on not getting here if call was not even accepted! */ - if (*p != rpc_success) { - resbuf->head[0].iov_len -= 2 * 4; + p = svcauth_gss_prepare_to_wrap(resbuf, gsd); + if (p == NULL) goto out; - } - p++; integ_offset = (u8 *)(p + 1) - (u8 *)resbuf->head[0].iov_base; integ_len = resbuf->len - integ_offset; BUG_ON(integ_len % 4); @@ -1222,17 +1233,9 @@ svcauth_gss_wrap_resp_priv(struct svc_rq int offset, *len; int pad; - p = gsd->body_start; - gsd->body_start = NULL; - /* move accept_stat to right place: */ - memcpy(p, p + 2, 4); - /* Don't wrap in failure case: */ - /* Counting on not getting here if call was not even accepted! */ - if (*p != rpc_success) { - resbuf->head[0].iov_len -= 2 * 4; + p = svcauth_gss_prepare_to_wrap(resbuf, gsd); + if (p == NULL) return 0; - } - p++; len = p++; offset = (u8 *)p - (u8 *)resbuf->head[0].iov_base; *p++ = htonl(gc->gc_seq); _ Patches currently in -mm which might be from bfields@xxxxxxxxxxxx are knfsd-drop-serv-option-to-svc_recv-and-svc_process.patch knfsd-drop-serv-option-to-svc_recv-and-svc_process-nfs-callback-fix-nfs-callback-fix.patch knfsd-check-return-value-of-lockd_up-in-write_ports.patch knfsd-move-makesock-failed-warning-into-make_socks.patch knfsd-correctly-handle-error-condition-from-lockd_up.patch knfsd-call-lockd_down-when-closing-a-socket-via-a-write-to-nfsd-portlist.patch knfsd-svcrpc-gss-factor-out-some-common-wrapping-code.patch knfsd-svcrpc-gss-fix-failure-on-svc_denied-in-integrity-case.patch knfsd-svcrpc-use-consistent-variable-name-for-the-reply-state.patch knfsd-nfsd4-refactor-exp_pseudoroot.patch knfsd-nfsd4-clean-up-exp_pseudoroot.patch knfsd-nfsd4-acls-relax-the-nfsv4-posix-mapping.patch knfsd-nfsd4-acls-fix-inheritance.patch knfsd-nfsd4-acls-simplify-nfs4_acl_nfsv4_to_posix-interface.patch knfsd-nfsd4-acls-fix-handling-of-zero-length-acls.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html