]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Support no-journal for dm-integrity devices.
authorRussell Harmon <eatnumber1@gmail.com>
Mon, 29 May 2023 01:51:36 +0000 (18:51 -0700)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 30 May 2023 07:35:46 +0000 (16:35 +0900)
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.

man/integritytab.xml
src/integritysetup/integrity-util.c

index 44f0a559290298dcdd94bd3bb1e81a6d4951ca46..44da039ddecf9dce658a9d5c8ec9612b5e2c00a1 100644 (file)
         </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>
 
index c2d2f950de56d05848ea09e1506b2b4381accf73..66f93e7d2eb2f86d0f5880c936a5e8116d99131f 100644 (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)