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
parent 53198bdea9
commit aeada055d1

View File

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