{
  "slug": "dm-log-writes",
  "term": "dm-log-writes",
  "aliases": [
    "Device-mapper log-writes target"
  ],
  "definition": "dm-log-writes is a Linux device-mapper target that records block modifications on a separate device for controlled replay and filesystem checks.",
  "note": "Ordinary completed writes wait for a later PREFLUSH. At flush mapping, the target captures the completed-write list; on completion, it queues that captured batch and the flush record. A write completing between those two events is not added retroactively. FUA requests take a separate completion path, while ordinary discards follow the pending-write ordering. [log-doc] [log-source]\n\nA mark is an annotation, not a flush. In the reviewed v6.12 log_mark path it joins the logging queue without draining unflushed_blocks. The final teardown marker is different: destruction first moves remaining entries. A replay endpoint therefore needs a stated synchronization contract. [log-source]\n\nRecord successful synchronization, backing-I/O errors and logger status separately. The v6.12 completion callback does not filter records by the error argument; a log entry is not a successful-write receipt. Treat logging_disabled as an incomplete recording, not a passing test. [log-source]\n\nCrashMonkey also records system calls to identify explicitly persisted files and directories for its oracle. A block log by itself does not supply that application-level expectation or reproduce the OSDI 2018 experiment. [mohan]",
  "status": "shipping",
  "advantages": [],
  "limitations": [
    {
      "text": "Logging and replay require isolated disposable storage; neither a complete trace nor a passing checker proves all crash states are safe.",
      "citationIds": [
        "log-doc",
        "mohan"
      ]
    }
  ],
  "related": [
    "device-mapper",
    "crash-test-oracle"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "citations": [
    {
      "id": "log-doc",
      "title": "Linux v6.12: dm-log-writes ordering, marks and replay interface.",
      "url": "https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/Documentation/admin-guide/device-mapper/log-writes.rst",
      "accessed": "2026-12-01"
    },
    {
      "id": "log-source",
      "title": "Linux v6.12: log_writes_map, normal_end_io, log_mark, teardown and logger status.",
      "url": "https://github.com/torvalds/linux/blob/adc218676eef25575469234709c2d87185ca223a/drivers/md/dm-log-writes.c",
      "accessed": "2026-12-01"
    },
    {
      "id": "mohan",
      "title": "Mohan et al. Finding Crash-Consistency Bugs with Bounded Black-Box Crash Testing. OSDI 2018, pp. 33-50, sections 4.4 and 5.1.",
      "url": "https://www.usenix.org/system/files/osdi18-mohan.pdf",
      "accessed": "2026-12-01"
    }
  ],
  "updated": "2026-12-01",
  "provenance": [
    "Static review of Linux v6.12 commit adc218676eef25575469234709c2d87185ca223a. No kernel target was loaded and no physical storage failure was tested.",
    "Original success-path queue model and tests: https://hesela.dev/research/dm-log-writes/model.mjs and https://hesela.dev/research/dm-log-writes/model.test.mjs.",
    "Human interpretation and limits: https://hesela.com/analyses/crash-testing-oracles-and-bounds/#dm-log-writes"
  ]
}
