diff options
author | Lennart Poettering <lennart@poettering.net> | 2017-08-09 18:18:53 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2017-08-29 16:01:19 +0200 |
commit | 715cbb81eee771dd0544db434d98b3e68ea5c7e9 (patch) | |
tree | 12d4716e5a3995966b1306672ac52866e69f55da | |
parent | Merge pull request #6636 from sourcejedi/fsync (diff) | |
download | systemd-715cbb81eee771dd0544db434d98b3e68ea5c7e9.tar.xz systemd-715cbb81eee771dd0544db434d98b3e68ea5c7e9.zip |
dissect: add a bit of debug logging if dm-crypt fails on us
-rw-r--r-- | src/shared/dissect-image.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 505a83f54f..f11b522558 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -838,15 +838,19 @@ static int decrypt_partition( r = crypt_init(&cd, m->node); if (r < 0) - return r; + return log_debug_errno(r, "Failed to initialize dm-crypt: %m"); r = crypt_load(cd, CRYPT_LUKS1, NULL); - if (r < 0) + if (r < 0) { + log_debug_errno(r, "Failed to load LUKS metadata: %m"); goto fail; + } r = crypt_activate_by_passphrase(cd, name, CRYPT_ANY_SLOT, passphrase, strlen(passphrase), ((flags & DISSECT_IMAGE_READ_ONLY) ? CRYPT_ACTIVATE_READONLY : 0) | ((flags & DISSECT_IMAGE_DISCARD_ON_CRYPTO) ? CRYPT_ACTIVATE_ALLOW_DISCARDS : 0)); + if (r < 0) + log_debug_errno(r, "Failed to activate LUKS device: %m"); if (r == -EPERM) { r = -EKEYREJECTED; goto fail; |