Silence query error messages for unsupported target types.

This commit is contained in:
Ondrej Kozina
2019-05-24 16:12:16 +02:00
parent cd1fe75987
commit 6f35fb5f80

View File

@@ -2378,7 +2378,7 @@ static int dm_target_query(struct crypt_device *cd, struct dm_target *tgt, const
const uint64_t *length, const char *target_type, const uint64_t *length, const char *target_type,
char *params, uint32_t get_flags, uint32_t *act_flags) char *params, uint32_t get_flags, uint32_t *act_flags)
{ {
int r = -EINVAL; int r = -ENOTSUP;
if (!strcmp(target_type, DM_CRYPT_TARGET)) if (!strcmp(target_type, DM_CRYPT_TARGET))
r = _dm_target_query_crypt(cd, get_flags, params, tgt, act_flags); r = _dm_target_query_crypt(cd, get_flags, params, tgt, act_flags);
@@ -2460,7 +2460,8 @@ static int _dm_query_device(struct crypt_device *cd, const char *name,
} }
if (r < 0) { if (r < 0) {
log_err(cd, _("Failed to query dm-%s segment."), target_type); if (r != -ENOTSUP)
log_err(cd, _("Failed to query dm-%s segment."), target_type);
goto out; goto out;
} }