diff --git a/man/integritytab.xml b/man/integritytab.xml index 44da039dde..12ec2933a9 100644 --- a/man/integritytab.xml +++ b/man/integritytab.xml @@ -73,10 +73,13 @@ - + - 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 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 66f93e7d2e..c29d4fcd5d 100644 --- a/src/integritysetup/integrity-util.c +++ b/src/integritysetup/integrity-util.c @@ -34,9 +34,22 @@ 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, "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)