Whamcloud - gitweb
timeout and assert in invalidate import.
[fs/lustre-release.git] / lustre / ptlrpc / sec_plain.c
index 5c75f66..2b69ced 100644 (file)
@@ -130,7 +130,6 @@ static
 int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
 {
         struct lustre_msg *msg = req->rq_repbuf;
-        __u16              wflvr;
         ENTRY;
 
         if (msg->lm_bufcount != PLAIN_PACK_SEGMENTS) {
@@ -138,16 +137,15 @@ int plain_ctx_verify(struct ptlrpc_cli_ctx *ctx, struct ptlrpc_request *req)
                 RETURN(-EPROTO);
         }
 
-        wflvr = WIRE_FLVR_RPC(msg->lm_secflvr);
-
         /* expect no user desc in reply */
-        if (PLAIN_WFLVR_HAS_USER(wflvr)) {
+        if (PLAIN_WFLVR_HAS_USER(msg->lm_secflvr)) {
                 CERROR("Unexpected udesc flag in reply\n");
                 RETURN(-EPROTO);
         }
 
         /* whether we sent with bulk or not, we expect the same in reply */
-        if (!equi(req->rq_pack_bulk == 1, PLAIN_WFLVR_HAS_BULK(wflvr))) {
+        if (!equi(req->rq_pack_bulk == 1,
+                  PLAIN_WFLVR_HAS_BULK(msg->lm_secflvr))) {
                 CERROR("%s bulk checksum in reply\n",
                        req->rq_pack_bulk ? "Missing" : "Unexpected");
                 RETURN(-EPROTO);
@@ -173,7 +171,7 @@ int plain_cli_wrap_bulk(struct ptlrpc_cli_ctx *ctx,
         LASSERT(req->rq_reqbuf->lm_bufcount == PLAIN_PACK_SEGMENTS);
 
         return bulk_csum_cli_request(desc, req->rq_bulk_read,
-                                     req->rq_flvr.sf_bulk_csum,
+                                     req->rq_flvr.sf_bulk_hash,
                                      req->rq_reqbuf,
                                      PLAIN_PACK_BULK_OFF);
 }
@@ -221,8 +219,8 @@ struct ptlrpc_cli_ctx *plain_sec_install_ctx(struct plain_sec *plsec)
                 ctx->cc_flags = PTLRPC_CTX_CACHED | PTLRPC_CTX_UPTODATE;
                 ctx->cc_vcred.vc_uid = 0;
                 spin_lock_init(&ctx->cc_lock);
-                INIT_LIST_HEAD(&ctx->cc_req_list);
-                INIT_LIST_HEAD(&ctx->cc_gc_chain);
+                CFS_INIT_LIST_HEAD(&ctx->cc_req_list);
+                CFS_INIT_LIST_HEAD(&ctx->cc_gc_chain);
 
                 plsec->pls_ctx = ctx;
                 atomic_inc(&plsec->pls_base.ps_nctx);
@@ -272,9 +270,9 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp,
 
         LASSERT(RPC_FLVR_POLICY(sf->sf_rpc) == SPTLRPC_POLICY_PLAIN);
 
-        if (sf->sf_bulk_priv != BULK_PRIV_ALG_NULL) {
-                CERROR("plain policy don't support bulk encryption: %u\n",
-                       sf->sf_bulk_priv);
+        if (sf->sf_bulk_ciph != BULK_CIPH_ALG_NULL) {
+                CERROR("plain policy don't support bulk cipher: %u\n",
+                       sf->sf_bulk_ciph);
                 RETURN(NULL);
         }
 
@@ -296,7 +294,7 @@ struct ptlrpc_sec *plain_create_sec(struct obd_import *imp,
         sec->ps_import = class_import_get(imp);
         sec->ps_flvr = *sf;
         sec->ps_lock = SPIN_LOCK_UNLOCKED;
-        INIT_LIST_HEAD(&sec->ps_gc_list);
+        CFS_INIT_LIST_HEAD(&sec->ps_gc_list);
         sec->ps_gc_interval = 0;
         sec->ps_gc_next = 0;
 
@@ -389,7 +387,7 @@ int plain_alloc_reqbuf(struct ptlrpc_sec *sec,
                 LASSERT(req->rq_bulk_read || req->rq_bulk_write);
 
                 buflens[PLAIN_PACK_BULK_OFF] = bulk_sec_desc_size(
-                                                req->rq_flvr.sf_bulk_csum, 1,
+                                                req->rq_flvr.sf_bulk_hash, 1,
                                                 req->rq_bulk_read);
         }
 
@@ -449,7 +447,7 @@ int plain_alloc_repbuf(struct ptlrpc_sec *sec,
                 LASSERT(req->rq_bulk_read || req->rq_bulk_write);
 
                 buflens[PLAIN_PACK_BULK_OFF] = bulk_sec_desc_size(
-                                                req->rq_flvr.sf_bulk_csum, 0,
+                                                req->rq_flvr.sf_bulk_hash, 0,
                                                 req->rq_bulk_read);
         }
 
@@ -609,7 +607,7 @@ int plain_alloc_rs(struct ptlrpc_request *req, int msgsize)
                 LASSERT(bsd);
 
                 buflens[PLAIN_PACK_BULK_OFF] = bulk_sec_desc_size(
-                                                        bsd->bsd_csum_alg, 0,
+                                                        bsd->bsd_hash_alg, 0,
                                                         req->rq_bulk_read);
         }
         rs_size += lustre_msg_size_v2(PLAIN_PACK_SEGMENTS, buflens);