From 3170e637e62a566f44220e064e2cfd5669a072ef Mon Sep 17 00:00:00 2001
From: alex <alex>
Date: Tue, 20 Sep 2005 22:51:19 +0000
Subject: [PATCH] - allocate tfm per every sign procedure (tfm isn't
 thread-safe)

---
 lustre/obdclass/capa.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lustre/obdclass/capa.c b/lustre/obdclass/capa.c
index 92335c61ea..5248cc292f 100644
--- a/lustre/obdclass/capa.c
+++ b/lustre/obdclass/capa.c
@@ -340,8 +340,9 @@ struct obd_capa *capa_renew(struct lustre_capa *capa, int type)
         return ocapa;
 }
 
-void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa)
+void capa_hmac(struct crypto_tfm *_tfm, __u8 *key, struct lustre_capa *capa)
 {
+        struct crypto_tfm *_tfm;
         int keylen = CAPA_KEY_LEN;
         struct scatterlist sl = {
                 .page   = virt_to_page(capa),
@@ -349,8 +350,10 @@ void capa_hmac(struct crypto_tfm *tfm, __u8 *key, struct lustre_capa *capa)
                 .length = sizeof(struct lustre_capa_data),
         };
 
+        tfm = crypto_alloc_tfm(CAPA_HMAC_ALG, 0);
         LASSERT(tfm);
         crypto_hmac(tfm, key, &keylen, &sl, 1, capa->lc_hmac);
+        crypto_free_tfm(tfm);
 }
 
 void capa_dup(void *dst, struct obd_capa *ocapa)
-- 
GitLab