OpenZFS · error log routing
A permanent error lands in one of two logs, decided by a single flag. A stray flag sent errors to the wrong one, where a later scan quietly made them permanent. Four commits fix the routing, heal the pools already hurt, and stop the tools from lying about it.
The errors the last completed scan found. This is the settled record: what zpool status reports and what an error scrub re-checks.
A scratch list a running scan fills as it goes. When the scan ends it is rotated into the last log, replacing it. It should be empty when no scan is running.
spa_scrub_active and nothing turned it back off, so ordinary read errors were filed in the scrub log as if a scan were running. During a real scan that right-hand path is correct; the fix is to set the flag only when a scan actually is.zpool status but zpool scrub -e cannot see it, and zpool clear never touches either log. The import-time rotation moves such a leftover into the last log, where the repair tool can finally reach it.Before, the errors were stranded in the scrub log and scrub -e refused. After import, the rotation put them in the last log, scrub -e ran, and reading them healed the ones whose blocks were gone.
A dataset destroy flipped the scan flag on and left it on, so read errors were filed as a scan's findings. Now the flag is set only while a scan truly runs, so nothing is misfiled.
dsl_scan_sync() · gate on dsl_scan_is_running()Pools already damaged by the old kernel are repaired on import: a leftover scrub log sitting over an empty last log is rotated into place, so an error scrub can reach the entries.
spa_load_impl() → spa_errlog_rotate()An error scrub on an empty last log used to exit zero in silence. Now it says the log is empty and to run a full scrub. Scrubbing all pools skips clean ones; -a refuses a pool name.
When recorded blocks were freed or rewritten, status printed a header promising files then listed none. Now it says plainly that the blocks could not be resolved to a file.
print_error_log()| Report | Opened | State | What it describes |
|---|---|---|---|
| openzfs/zfs#13859 | 2022-09-09 | open | Permanent errors after a clean scrub, with nothing else wrong |
| openzfs/zfs#14433 | 2023-01-25 | open | Permanent errors listed against UNKNOWN files |
| openzfs/zfs#15876 | 2024-02-10 | open | Chronic corruption that lists no affected objects |
| openzfs/zfs#16158 | 2024-05-03 | open | Permanent errors that point to no files — the canonical report |
| openzfs/zfs#16737 | 2024-11-09 | open | zpool status reports inconsistent error information (count vs list) |
| openzfs/zfs#18678 | 2026-06-15 | open | Intermittent false permanent errors |