diff --git a/lustre/ptlrpc/gss/sec_gss.c b/lustre/ptlrpc/gss/sec_gss.c index 3312239e2c66c044eff5c028a728c027b2af716f..12290916eec1c3922e6cf0edd629a5087d8dfea4 100644 --- a/lustre/ptlrpc/gss/sec_gss.c +++ b/lustre/ptlrpc/gss/sec_gss.c @@ -1869,7 +1869,10 @@ int gss_svc_sign(struct ptlrpc_request *req, rs->rs_repdata_len = rc; if (likely(req->rq_packed_final)) { - req->rq_reply_off = gss_at_reply_off_integ; + if (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) + req->rq_reply_off = gss_at_reply_off_integ; + else + req->rq_reply_off = 0; } else { if (svc == SPTLRPC_SVC_NULL) rs->rs_repbuf->lm_cksum = crc32_le(!(__u32) 0, @@ -2601,7 +2604,8 @@ static int gss_svc_seal(struct ptlrpc_request *req, memcpy(lustre_msg_buf(rs->rs_repbuf, 1, 0), token.data, token.len); /* reply offset */ - if (likely(req->rq_packed_final)) + if (req->rq_packed_final && + (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) req->rq_reply_off = gss_at_reply_off_priv; else req->rq_reply_off = 0; diff --git a/lustre/ptlrpc/pack_generic.c b/lustre/ptlrpc/pack_generic.c index 97ea280fe97364713a7e2b8b03fe2ff98e94d02e..42790f125b17e64a1e6322ac0f422d400ead8db0 100644 --- a/lustre/ptlrpc/pack_generic.c +++ b/lustre/ptlrpc/pack_generic.c @@ -779,6 +779,7 @@ __u32 lustre_msghdr_get_flags(struct lustre_msg *msg) return 0; } } +EXPORT_SYMBOL(lustre_msghdr_get_flags); void lustre_msghdr_set_flags(struct lustre_msg *msg, __u32 flags) { diff --git a/lustre/ptlrpc/sec.c b/lustre/ptlrpc/sec.c index d29a21d69361b7f87400d6c7500fc1c6f880179e..977ac89d2d181b983d692e3d060d0b36a40f09ac 100644 --- a/lustre/ptlrpc/sec.c +++ b/lustre/ptlrpc/sec.c @@ -933,7 +933,8 @@ int sptlrpc_cli_unwrap_reply(struct ptlrpc_request *req) LASSERT(req->rq_repmsg == NULL); LASSERT(req->rq_reply_off + req->rq_nob_received <= req->rq_repbuf_len); - if (req->rq_reply_off == 0) { + if (req->rq_reply_off == 0 && + (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT)) { CERROR("real reply with offset 0\n"); return -EPROTO; } diff --git a/lustre/ptlrpc/sec_null.c b/lustre/ptlrpc/sec_null.c index ea7d5aefb983b1cf02ed8997c313d0509db4a41d..c63401baa886d97a04c57fd378f6f9c719c20b10 100644 --- a/lustre/ptlrpc/sec_null.c +++ b/lustre/ptlrpc/sec_null.c @@ -371,7 +371,10 @@ int null_authorize(struct ptlrpc_request *req) rs->rs_repdata_len = req->rq_replen; if (likely(req->rq_packed_final)) { - req->rq_reply_off = lustre_msg_early_size(); + if (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) + req->rq_reply_off = lustre_msg_early_size(); + else + req->rq_reply_off = 0; } else { rs->rs_repbuf->lm_cksum = crc32_le(!(__u32) 0, diff --git a/lustre/ptlrpc/sec_plain.c b/lustre/ptlrpc/sec_plain.c index 291a9fb5264500ee1756f209fdb0f82d6556e0b3..fd4e723a02bf5ada1dd18aaefbac3ed19d6ec8a4 100644 --- a/lustre/ptlrpc/sec_plain.c +++ b/lustre/ptlrpc/sec_plain.c @@ -712,7 +712,10 @@ int plain_authorize(struct ptlrpc_request *req) rs->rs_repdata_len = len; if (likely(req->rq_packed_final)) { - req->rq_reply_off = plain_at_offset; + if (lustre_msghdr_get_flags(req->rq_reqmsg) & MSGHDR_AT_SUPPORT) + req->rq_reply_off = plain_at_offset; + else + req->rq_reply_off = 0; } else { msg->lm_cksum = crc32_le(!(__u32) 0, lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0),