1
0
mirror of https://github.com/systemd/systemd.git synced 2025-06-02 17:07:47 +03:00

Support no-journal for dm-integrity devices.

As documented in integritysetup.8, dm-integrity devices support running
without a journal whatsoever. This change allows the
CRYPT_ACTIVATE_NO_JOURNAL flag (the same as is used with `integritysetup
--integrity-no-journal`) to be passed in during dmsetup by specifying
the `no-journal` option in integritytab.5.
This commit is contained in:
Russell Harmon 2023-05-28 18:51:36 -07:00 committed by Yu Watanabe
parent dd3775ab88
commit bcc1ee56c0
2 changed files with 14 additions and 0 deletions

View File

@ -72,6 +72,17 @@
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>no-journal</option></term>
<listitem><para>
Disable the journal. Corresponds to the "direct writes" mode documented in
<ulink url="https://docs.kernel.org/admin-guide/device-mapper/dm-integrity.html">the dm-integrity documentation</ulink>.
Note that without a journal, if there is a crash, it is possible that the integrity tags and data will not match. If used, the journal-*
options below will have no effect if passed.
</para></listitem>
</varlistentry>
<varlistentry>
<term><option>journal-watermark=[0..100]%</option></term>

View File

@ -34,6 +34,9 @@ int parse_integrity_options(
else if (streq(word, "allow-discards")) {
if (ret_activate_flags)
*ret_activate_flags |= CRYPT_ACTIVATE_ALLOW_DISCARDS;
} else if (streq(word, "no-journal")) {
if (ret_activate_flags)
*ret_activate_flags |= CRYPT_ACTIVATE_NO_JOURNAL;
} else if ((val = startswith(word, "journal-watermark="))) {
r = parse_percent(val);
if (r < 0)