</varlistentry>
<varlistentry>
- <term><option>no-journal</option></term>
+ <term><option>mode=(journal|bitmap|direct)</option></term>
<listitem><para>
- Disable the journal. Corresponds to the "direct writes" mode documented in
+ Enable journaled, bitmapped or direct (passthrough) mode. Journaled mode is the default when this option is not specified.
+ It provides safety against crashes, but can be slow because all data has to be written twice.
+ Bitmap mode is more efficient since it requires only a single write, but it is less reliable because if data corruption happens when the machine crashes, it may not be detected.
+ Direct mode disables the journal and the bitmap. 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.
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, "mode="))) {
+ if (streq(val, "journal")) {
+ if (ret_activate_flags)
+ *ret_activate_flags &= ~(CRYPT_ACTIVATE_NO_JOURNAL | CRYPT_ACTIVATE_NO_JOURNAL_BITMAP);
+ } else if (streq(val, "bitmap")) {
+ if (ret_activate_flags) {
+ *ret_activate_flags &= ~CRYPT_ACTIVATE_NO_JOURNAL;
+ *ret_activate_flags |= CRYPT_ACTIVATE_NO_JOURNAL_BITMAP;
+ }
+ } else if (streq(val, "direct")) {
+ if (ret_activate_flags) {
+ *ret_activate_flags |= CRYPT_ACTIVATE_NO_JOURNAL;
+ *ret_activate_flags &= ~CRYPT_ACTIVATE_NO_JOURNAL_BITMAP;
+ }
+ } else
+ log_warning("Encountered unknown mode option '%s', ignoring.", val);
} else if ((val = startswith(word, "journal-watermark="))) {
r = parse_percent(val);
if (r < 0)