- if (SPTLRPC_FLVR_BASE(req->rq_flvr.sf_rpc) !=
- SPTLRPC_FLVR_BASE(SPTLRPC_FLVR_PLAIN) ||
- SPTLRPC_FLVR_BULK_TYPE(req->rq_flvr.sf_rpc) !=
- SPTLRPC_FLVR_BULK_TYPE(SPTLRPC_FLVR_PLAIN)) {
- CERROR("Invalid rpc flavor %x\n", req->rq_flvr.sf_rpc);
- RETURN(SECSVC_DROP);
- }
-
- if (msg->lm_bufcount < PLAIN_PACK_SEGMENTS) {
- CERROR("unexpected request buf count %u\n", msg->lm_bufcount);
- RETURN(SECSVC_DROP);
- }
-
- swabbed = ptlrpc_req_need_swab(req);
-
- phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, sizeof(*phdr));
- if (phdr == NULL) {
- CERROR("missing plain header\n");
- RETURN(-EPROTO);
- }
-
- if (phdr->ph_ver != 0) {
- CERROR("Invalid header version\n");
- RETURN(-EPROTO);
- }
-
- if (phdr->ph_bulk_hash_alg >= BULK_HASH_ALG_MAX) {
- CERROR("invalid hash algorithm: %u\n", phdr->ph_bulk_hash_alg);
- RETURN(-EPROTO);
- }
-
- req->rq_sp_from = phdr->ph_sp;
- req->rq_flvr.u_bulk.hash.hash_alg = phdr->ph_bulk_hash_alg;
-
- if (phdr->ph_flags & PLAIN_FL_USER) {
- if (sptlrpc_unpack_user_desc(msg, PLAIN_PACK_USER_OFF,
- swabbed)) {
- CERROR("Mal-formed user descriptor\n");
- RETURN(SECSVC_DROP);
- }
-
- req->rq_pack_udesc = 1;
- req->rq_user_desc = lustre_msg_buf(msg, PLAIN_PACK_USER_OFF, 0);
- }
-
- if (phdr->ph_flags & PLAIN_FL_BULK) {
- if (plain_unpack_bsd(msg, swabbed))
- RETURN(SECSVC_DROP);
-
- req->rq_pack_bulk = 1;
- }
+ if (SPTLRPC_FLVR_BASE(req->rq_flvr.sf_rpc) !=
+ SPTLRPC_FLVR_BASE(SPTLRPC_FLVR_PLAIN) ||
+ SPTLRPC_FLVR_BULK_TYPE(req->rq_flvr.sf_rpc) !=
+ SPTLRPC_FLVR_BULK_TYPE(SPTLRPC_FLVR_PLAIN)) {
+ CERROR("Invalid rpc flavor %x\n", req->rq_flvr.sf_rpc);
+ RETURN(SECSVC_DROP);
+ }
+
+ if (msg->lm_bufcount < PLAIN_PACK_SEGMENTS) {
+ CERROR("unexpected request buf count %u\n", msg->lm_bufcount);
+ RETURN(SECSVC_DROP);
+ }
+
+ swabbed = ptlrpc_req_need_swab(req);
+
+ phdr = lustre_msg_buf(msg, PLAIN_PACK_HDR_OFF, sizeof(*phdr));
+ if (phdr == NULL) {
+ CERROR("missing plain header\n");
+ RETURN(-EPROTO);
+ }
+
+ if (phdr->ph_ver != 0) {
+ CERROR("Invalid header version\n");
+ RETURN(-EPROTO);
+ }
+
+ if (phdr->ph_bulk_hash_alg >= BULK_HASH_ALG_MAX) {
+ CERROR("invalid hash algorithm: %u\n", phdr->ph_bulk_hash_alg);
+ RETURN(-EPROTO);
+ }
+
+ req->rq_sp_from = phdr->ph_sp;
+ req->rq_flvr.u_bulk.hash.hash_alg = phdr->ph_bulk_hash_alg;
+
+ if (phdr->ph_flags & PLAIN_FL_USER) {
+ if (sptlrpc_unpack_user_desc(msg, PLAIN_PACK_USER_OFF,
+ swabbed)) {
+ CERROR("Mal-formed user descriptor\n");
+ RETURN(SECSVC_DROP);
+ }
+
+ req->rq_pack_udesc = 1;
+ req->rq_user_desc = lustre_msg_buf(msg, PLAIN_PACK_USER_OFF, 0);
+ }
+
+ if (phdr->ph_flags & PLAIN_FL_BULK) {
+ if (plain_unpack_bsd(msg, swabbed))
+ RETURN(SECSVC_DROP);
+
+ req->rq_pack_bulk = 1;
+ }