From: Russell Harmon Date: Mon, 29 May 2023 01:51:36 +0000 (-0700) Subject: Support no-journal for dm-integrity devices. X-Git-Tag: v254-rc1~345 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=bcc1ee56c0404b3650979d4cedfb8a6085703fb4;p=thirdparty%2Fsystemd.git 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. --- diff --git a/man/integritytab.xml b/man/integritytab.xml index 44f0a559290..44da039ddec 100644 --- a/man/integritytab.xml +++ b/man/integritytab.xml @@ -72,6 +72,17 @@ + + + + + Disable the journal. Corresponds to the "direct writes" mode documented in + the dm-integrity documentation. + 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. + + + diff --git a/src/integritysetup/integrity-util.c b/src/integritysetup/integrity-util.c index c2d2f950de5..66f93e7d2eb 100644 --- a/src/integritysetup/integrity-util.c +++ b/src/integritysetup/integrity-util.c @@ -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)