[dm-devel] [PATCH 2/7] dm crypt: remove redundant setkey call

Milan Broz mbroz at redhat.com
Tue Dec 21 15:28:14 UTC 2010


All keys are already set in crypt_ctr_cipher() call,
no need set the key again later.

(introduced in per cpu patch)

Signed-off-by: Milan Broz <mbroz at redhat.com>
---
 drivers/md/dm-crypt.c |   11 +----------
 1 files changed, 1 insertions(+), 10 deletions(-)

diff --git a/drivers/md/dm-crypt.c b/drivers/md/dm-crypt.c
index 6aeb1fe..dbed83d 100644
--- a/drivers/md/dm-crypt.c
+++ b/drivers/md/dm-crypt.c
@@ -1317,10 +1317,9 @@ bad_mem:
 static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 {
 	struct crypt_config *cc;
-	struct crypt_cpu *cs;
 	unsigned int key_size;
 	unsigned long long tmpll;
-	int ret, cpu;
+	int ret;
 
 	if (argc != 5) {
 		ti->error = "Not enough arguments";
@@ -1372,14 +1371,6 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv)
 		goto bad;
 	}
 
-	for_each_possible_cpu(cpu) {
-		cs = per_cpu_ptr(cc->cpu, cpu);
-		if (crypto_ablkcipher_setkey(cs->tfm, cc->key, key_size) < 0) {
-			ti->error = "Error setting key";
-			goto bad;
-		}
-	}
-
 	ret = -EINVAL;
 	if (sscanf(argv[2], "%llu", &tmpll) != 1) {
 		ti->error = "Invalid iv_offset sector";
-- 
1.7.2.3




More information about the dm-devel mailing list