Print a visible error if requesting resize on unsupported format.

Fixes: #571.
This commit is contained in:
Milan Broz
2020-09-19 22:05:42 +02:00
parent 5d07b0730c
commit 6ed739d9ca

View File

@@ -2765,6 +2765,11 @@ int crypt_resize(struct crypt_device *cd, const char *name, uint64_t new_size)
if (!cd || !cd->type || !name)
return -EINVAL;
if (isTCRYPT(cd->type) || isBITLK(cd->type)) {
log_err(cd, _("This operation is not supported for this device type."));
return -ENOTSUP;
}
log_dbg(cd, "Resizing device %s to %" PRIu64 " sectors.", name, new_size);
r = dm_query_device(cd, name, DM_ACTIVE_CRYPT_KEYSIZE | DM_ACTIVE_CRYPT_KEY, &dmdq);