]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/5.0.19/dm-crypt-move-detailed-message-into-debug-level.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 5.0.19 / dm-crypt-move-detailed-message-into-debug-level.patch
1 From 7a1cd7238fde6ab367384a4a2998cba48330c398 Mon Sep 17 00:00:00 2001
2 From: Milan Broz <gmazyland@gmail.com>
3 Date: Wed, 15 May 2019 16:23:43 +0200
4 Subject: dm crypt: move detailed message into debug level
5
6 From: Milan Broz <gmazyland@gmail.com>
7
8 commit 7a1cd7238fde6ab367384a4a2998cba48330c398 upstream.
9
10 The information about tag size should not be printed without debug info
11 set. Also print device major:minor in the error message to identify the
12 device instance.
13
14 Also use rate limiting and debug level for info about used crypto API
15 implementaton. This is important because during online reencryption
16 the existing message saturates syslog (because we are moving hotzone
17 across the whole device).
18
19 Cc: stable@vger.kernel.org
20 Signed-off-by: Milan Broz <gmazyland@gmail.com>
21 Signed-off-by: Mike Snitzer <snitzer@redhat.com>
22 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
23
24 ---
25 drivers/md/dm-crypt.c | 9 +++++----
26 1 file changed, 5 insertions(+), 4 deletions(-)
27
28 --- a/drivers/md/dm-crypt.c
29 +++ b/drivers/md/dm-crypt.c
30 @@ -949,6 +949,7 @@ static int crypt_integrity_ctr(struct cr
31 {
32 #ifdef CONFIG_BLK_DEV_INTEGRITY
33 struct blk_integrity *bi = blk_get_integrity(cc->dev->bdev->bd_disk);
34 + struct mapped_device *md = dm_table_get_md(ti->table);
35
36 /* From now we require underlying device with our integrity profile */
37 if (!bi || strcasecmp(bi->profile->name, "DM-DIF-EXT-TAG")) {
38 @@ -968,7 +969,7 @@ static int crypt_integrity_ctr(struct cr
39
40 if (crypt_integrity_aead(cc)) {
41 cc->integrity_tag_size = cc->on_disk_tag_size - cc->integrity_iv_size;
42 - DMINFO("Integrity AEAD, tag size %u, IV size %u.",
43 + DMDEBUG("%s: Integrity AEAD, tag size %u, IV size %u.", dm_device_name(md),
44 cc->integrity_tag_size, cc->integrity_iv_size);
45
46 if (crypto_aead_setauthsize(any_tfm_aead(cc), cc->integrity_tag_size)) {
47 @@ -976,7 +977,7 @@ static int crypt_integrity_ctr(struct cr
48 return -EINVAL;
49 }
50 } else if (cc->integrity_iv_size)
51 - DMINFO("Additional per-sector space %u bytes for IV.",
52 + DMDEBUG("%s: Additional per-sector space %u bytes for IV.", dm_device_name(md),
53 cc->integrity_iv_size);
54
55 if ((cc->integrity_tag_size + cc->integrity_iv_size) != bi->tag_size) {
56 @@ -1890,7 +1891,7 @@ static int crypt_alloc_tfms_skcipher(str
57 * algorithm implementation is used. Help people debug performance
58 * problems by logging the ->cra_driver_name.
59 */
60 - DMINFO("%s using implementation \"%s\"", ciphermode,
61 + DMDEBUG_LIMIT("%s using implementation \"%s\"", ciphermode,
62 crypto_skcipher_alg(any_tfm(cc))->base.cra_driver_name);
63 return 0;
64 }
65 @@ -1910,7 +1911,7 @@ static int crypt_alloc_tfms_aead(struct
66 return err;
67 }
68
69 - DMINFO("%s using implementation \"%s\"", ciphermode,
70 + DMDEBUG_LIMIT("%s using implementation \"%s\"", ciphermode,
71 crypto_aead_alg(any_tfm_aead(cc))->base.cra_driver_name);
72 return 0;
73 }