Return suspended status also for unknow target types.

This patch allows dm_status_suspended() to report if device
is suspended or not also for unknown target types from
libcryptsetup perspective (e.g.: dm-cache).
This commit is contained in:
Ondrej Kozina
2024-08-22 13:41:03 +02:00
committed by Milan Broz
parent 7d7b3d87c2
commit 44b8dd8cb1

View File

@@ -1897,7 +1897,7 @@ int dm_status_suspended(struct crypt_device *cd, const char *name)
r = dm_status_dmi(name, &dmi, NULL, NULL);
dm_exit_context();
if (r < 0)
if (r < 0 && r != -EEXIST)
return r;
return dmi.suspended ? 1 : 0;