From: Lennart Poettering Date: Thu, 1 Jun 2023 13:31:25 +0000 (+0200) Subject: {crypt|verity}setup: mention volume name in some error messages X-Git-Tag: v254-rc1~305^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ffe0da297d7ec4723b583ed19f31a2d605cb9142;p=thirdparty%2Fsystemd.git {crypt|verity}setup: mention volume name in some error messages --- diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index ad86801844f..d58defcc42f 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -2324,13 +2324,13 @@ static int run(int argc, char *argv[]) { return 0; } if (r < 0) - return log_error_errno(r, "crypt_init_by_name() failed: %m"); + return log_error_errno(r, "crypt_init_by_name() for volume '%s' failed: %m", volume); cryptsetup_enable_logging(cd); r = crypt_deactivate(cd, volume); if (r < 0) - return log_error_errno(r, "Failed to deactivate: %m"); + return log_error_errno(r, "Failed to deactivate '%s': %m", volume); } else return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown verb %s.", verb); diff --git a/src/veritysetup/veritysetup.c b/src/veritysetup/veritysetup.c index be95c1f2064..d73c2d39fbe 100644 --- a/src/veritysetup/veritysetup.c +++ b/src/veritysetup/veritysetup.c @@ -398,7 +398,7 @@ static int run(int argc, char *argv[]) { } else r = crypt_activate_by_volume_key(cd, volume, m, l, arg_activate_flags); if (r < 0) - return log_error_errno(r, "Failed to set up verity device: %m"); + return log_error_errno(r, "Failed to set up verity device '%s': %m", volume); } else if (streq(verb, "detach")) { const char *volume; @@ -410,17 +410,17 @@ static int run(int argc, char *argv[]) { r = crypt_init_by_name(&cd, volume); if (r == -ENODEV) { - log_info("Volume %s already inactive.", volume); + log_info("Volume %s 'already' inactive.", volume); return 0; } if (r < 0) - return log_error_errno(r, "crypt_init_by_name() failed: %m"); + return log_error_errno(r, "crypt_init_by_name() for volume '%s' failed: %m", volume); cryptsetup_enable_logging(cd); r = crypt_deactivate(cd, volume); if (r < 0) - return log_error_errno(r, "Failed to deactivate: %m"); + return log_error_errno(r, "Failed to deactivate volume '%s': %m", volume); } else return log_error_errno(SYNTHETIC_ERRNO(EINVAL), "Unknown verb %s.", verb);