HomeFreeBSD

Fix corruption caused by mmap flushing problems

Description

Fix corruption caused by mmap flushing problems

  1. Make mmap flushes synchronous. Linux may skip flushing dirty pages already in writeback unless data-integrity sync is requested.
  1. Change zfs_putpage to use TXG_WAIT. Otherwise dirty pages may be skipped due to DMU pushing back on TX assign.
  1. Add missing mmap flush when doing block cloning.
  1. While here, pass errors from putpage to writepage/writepages.

This change fixes corruption edge cases, but unfortunately adds
synchronous ZIL flushes for dirty mmap pages to llseek and bclone
operations. It may be possible to avoid these sync writes later
but would need more tricky refactoring of the writeback code.

Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Robert Evans <evansr@google.com>
Closes #15933
Closes #16019

Details

Provenance
Robert Evans <rrevans@gmail.com>Authored on Mar 25 2024, 9:56 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Mar 30 2024, 12:10 AM
Parents
rGeebf00bee91d: vdev_disk: default to classic submission for 2.2.x
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rGdeb7a84231af: Fix corruption caused by mmap flushing problems (authored by Robert Evans <rrevans@gmail.com>).Mar 30 2024, 12:10 AM