Commit 37af6560 authored by Christophe Saout's avatar Christophe Saout Committed by Linus Torvalds

[PATCH] Fix dmsetup table output change

Fix dm-crypt after the block cipher API changes to correctly return the
backwards compatible cipher-chainmode[-ivmode] format for "dmsetup
table".
Signed-off-by: default avatarChristophe Saout <christophe@saout.de>
Cc: Alasdair G Kergon <agk@redhat.com>
Cc: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>

diff linux-2.6.19-rc3.orig/drivers/md/dm-crypt.c linux-2.6.19-rc3/drivers/md/dm-crypt.c
parent c1b707d2
...@@ -915,8 +915,6 @@ static int crypt_status(struct dm_target *ti, status_type_t type, ...@@ -915,8 +915,6 @@ static int crypt_status(struct dm_target *ti, status_type_t type,
char *result, unsigned int maxlen) char *result, unsigned int maxlen)
{ {
struct crypt_config *cc = (struct crypt_config *) ti->private; struct crypt_config *cc = (struct crypt_config *) ti->private;
const char *cipher;
const char *chainmode = NULL;
unsigned int sz = 0; unsigned int sz = 0;
switch (type) { switch (type) {
...@@ -925,14 +923,11 @@ static int crypt_status(struct dm_target *ti, status_type_t type, ...@@ -925,14 +923,11 @@ static int crypt_status(struct dm_target *ti, status_type_t type,
break; break;
case STATUSTYPE_TABLE: case STATUSTYPE_TABLE:
cipher = crypto_blkcipher_name(cc->tfm);
chainmode = cc->chainmode;
if (cc->iv_mode) if (cc->iv_mode)
DMEMIT("%s-%s-%s ", cipher, chainmode, cc->iv_mode); DMEMIT("%s-%s-%s ", cc->cipher, cc->chainmode,
cc->iv_mode);
else else
DMEMIT("%s-%s ", cipher, chainmode); DMEMIT("%s-%s ", cc->cipher, cc->chainmode);
if (cc->key_size > 0) { if (cc->key_size > 0) {
if ((maxlen - sz) < ((cc->key_size << 1) + 1)) if ((maxlen - sz) < ((cc->key_size << 1) + 1))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment