Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__openzfs: Auto-mitigate data corruption bug #27

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 26 additions & 1 deletion type/__openzfs/manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/sh -e
#
# 2020,2023 Dennis Camera (dennis.camera at riiengineering.ch)
# 2020,2023,2024 Dennis Camera (dennis.camera at riiengineering.ch)
#
# This file is part of skonfig-extra.
#
Expand Down Expand Up @@ -166,6 +166,31 @@ then
EOF
fi

# HACK: Workaround 2023 data corruption issue
# https://github.com/openzfs/zfs/releases/tag/zfs-2.1.5
# https://github.com/openzfs/zfs/releases/tag/zfs-2.2.2
# https://github.com/openzfs/zfs/issues/15526
# https://github.com/openzfs/zfs/pull/15571
if test -n "${kmod_version}"
then
if { version_ge "${kmod_version}" 2.2.0 && ! version_ge "${kmod_version}" 2.2.2; } \
|| { version_ge "${kmod_version}" 2.1.5 && ! version_ge "${kmod_version}" 2.1.14; }
then
# We only need to apply this hack on OpenZFS < 2.1.14 or < 2.2.2
zfs_dmu_offset_next_sync=0
fi

require= \
__block /etc/modprobe.d/zfs.conf:cdist-data-corruption-workaround \
--state "$(test "${zfs_dmu_offset_next_sync-}" && echo present || echo absent)" \
--file /etc/modprobe.d/zfs.conf \
--prefix '# skonfig:zfs-corruption-mitigation' \
--suffix '#/skonfig:zfs-corruption-mitigation' \
-text - <<-EOF
options zfs zfs_dmu_offset_next_sync=$((zfs_dmu_offset_next_sync))
EOF
fi

set_zed_rc() {
require=__package_apt/zfs-zed \
__key_value /etc/zfs/zed.d/zed.rc:"$1" \
Expand Down