# Data corruption bug in OpenZFS

**URL:** <https://forum.storj.io/t/data-corruption-bug-in-openzfs/24461>\
**Category:** Uncategorized\
**Tags:** zfs, hardware\
**Created:** [November 26, 2023, 12:11pm UTC](https://forum.storj.io/t/data-corruption-bug-in-openzfs/24461 "2023-11-26T12:11:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Toyoo](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/toyoo/32/1126_2.png) [@Toyoo](https://forum.storj.io/u/Toyoo)\
**Post date:** [November 26, 2023, 12:11pm UTC](https://forum.storj.io/t/data-corruption-bug-in-openzfs/24461/1 "2023-11-26T12:11:41Z")

</div>

There seems to be a data corruption bug under investigation by OpenZFS: [some copied files are corrupted (chunks replaced by zeros) · Issue #15526 · openzfs/zfs · GitHub](https://github.com/openzfs/zfs/issues/15526). There are a lot of people that can reproduce the problem in diverse environments, including Fedora, Debian, TrueNAS Core, Proxmox, reproduced with versions as old as the 2.1.x series (run `zfs --version` to check).

zfs\_dmu\_offset\_next\_sync=0, zfs\_bclone\_enabled=0 seem to reduce the frequency of the problem, there might be a performance impact though.

The root cause has probably been found, and patches are being prepared. And, _as far as I understand_, it seems there should be _no impact_ on storage nodes in regular operation, as they do not perform the system calls that seem to trigger the bug (`copy_file_range` in a massively concurrent workload). On the other side, if you were migrating a node, tools as simple as `cp` could trigger it. Software build scripts, torrents, thin-provisioned virtual machines are some use cases that seem to be affected the most.

Stay safe and upgrade your OpenZFS version as soon as an official bug fix shows up!

---

<div class="post-metadata">

**Author:** ![Pentium100](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/pentium100/32/6082_2.png) [@Pentium100](https://forum.storj.io/u/Pentium100)\
**Post date:** [November 27, 2023, 11:55am UTC](https://forum.storj.io/t/data-corruption-bug-in-openzfs/24461/2 "2023-11-27T11:55:32Z")

</div>

From skimming the super long thread there, it looks like (feel free to correct me if I am wrong):

1. The issue starts with 2.1.x, but gets much worse with 2.2.x (great for Debian to not upgrade immediately)
2. Setting `zfs_dmu_offset_next_sync` to zero on 2.1.x (it was zero by default up to 2.1.5) avoids the problem
3. zvols do not seem to be affected.

I recently upgraded the host where the node VM is to Debian 12 which has zfs 2.1.13, but I only use zvols, so it looks like I’m safe. I still set that parameter to zero.

My file server (which stores files on zfs and not just zvols) runs debian 10 and zfs 2.0.3, so it should be safe. Good thing I did not upgrade it.
