AT: fix reply offset calculate and check.
b=17404
r=h.huang
r=nathan
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,
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;
return 0;
}
}
+EXPORT_SYMBOL(lustre_msghdr_get_flags);
void lustre_msghdr_set_flags(struct lustre_msg *msg, __u32 flags)
{
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;
}
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,
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),