diff --git a/src/utils_reencrypt.c b/src/utils_reencrypt.c index c01f048d..dfb80a88 100644 --- a/src/utils_reencrypt.c +++ b/src/utils_reencrypt.c @@ -97,13 +97,15 @@ static int get_active_device_name(struct crypt_device *cd, const char *data_devi if (!ARG_SET(OPT_BATCH_MODE_ID)) log_std(_("Auto-detected active dm device '%s' for data device %s.\n"), *r_active_name, data_device); } else if (r < 0) { - if (r == -ENOTBLK) - log_std(_("Device %s is not a block device.\n"), data_device); - else + if (r != -ENOTBLK) { log_err(_("Failed to auto-detect device %s holders."), data_device); + return -EINVAL; + } r = -EINVAL; if (!ARG_SET(OPT_BATCH_MODE_ID)) { + log_std(_("Device %s is not a block device.\n"), data_device); + r = asprintf(&msg, _("Unable to decide if device %s is activated or not.\n" "Are you sure you want to proceed with reencryption in offline mode?\n" "It may lead to data corruption if the device is actually activated.\n"