X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Fptlrpc%2Fsec_plain.c;h=291a9fb5264500ee1756f209fdb0f82d6556e0b3;hb=1940e679ad3a5cddd8c8babd2e558477b3143053;hp=024e29b0c36069adb2a596ef66322d5d79cc10a9;hpb=7a6b9dafef17d2c610cb2d5c45c6e751a94b3c12;p=fs%2Flustre-release.git diff --git a/lustre/ptlrpc/sec_plain.c b/lustre/ptlrpc/sec_plain.c index 024e29b..291a9fb 100644 --- a/lustre/ptlrpc/sec_plain.c +++ b/lustre/ptlrpc/sec_plain.c @@ -151,7 +151,6 @@ static int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) { struct lustre_msg *msg = req->rq_repdata; - int early = 0; __u32 cksum; ENTRY; @@ -160,18 +159,13 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) RETURN(-EPROTO); } - /* find out if it's an early reply */ - if ((char *) msg < req->rq_repbuf || - (char *) msg >= req->rq_repbuf + req->rq_repbuf_len) - early = 1; - /* expect no user desc in reply */ if (PLAIN_WFLVR_HAS_USER(msg->lm_secflvr)) { CERROR("Unexpected udesc flag in reply\n"); RETURN(-EPROTO); } - if (unlikely(early)) { + if (unlikely(req->rq_early)) { cksum = crc32_le(!(__u32) 0, lustre_msg_buf(msg, PLAIN_PACK_MSG_OFF, 0), lustre_msg_buflen(msg, PLAIN_PACK_MSG_OFF)); @@ -183,7 +177,7 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req) } else { /* whether we sent with bulk or not, we expect the same * in reply, except for early reply */ - if (!early && + if (!req->rq_early && !equi(req->rq_pack_bulk == 1, PLAIN_WFLVR_HAS_BULK(msg->lm_secflvr))) { CERROR("%s bulk checksum in reply\n",