Suspend and resume also dm-integrity device with AEAD.

Currently we suspend top-level device only.

With OPAL, the underlying device will start to return errors
once OPAL LR is locked.

If the dm-integrity device is not suspended, regular journal
flush corrupts the device (journal write failure),
corrupting data above it.

Suspending the whole stack should fix the issue.
This commit is contained in:
Milan Broz
2023-11-15 16:06:02 +01:00
parent 0f51b5bacb
commit 6b2cf68713
3 changed files with 98 additions and 7 deletions

View File

@@ -3041,6 +3041,18 @@ const char *dm_get_dir(void)
return dm_dir();
}
int dm_get_iname(const char *name, char **iname, bool with_path)
{
int r;
if (with_path)
r = asprintf(iname, "%s/%s_dif", dm_get_dir(), name);
else
r = asprintf(iname, "%s_dif", name);
return r < 0 ? -ENOMEM : 0;
}
int dm_is_dm_device(int major)
{
return dm_is_dm_major((uint32_t)major);