Public bug reported:

The zfs 2.4.1 in resolute (2.4.1-1ubuntu5.1) has the block cloning read
corruption from openzfs #18412, and so does the zfs.ko that the noble
HWE 7.0 kernels ship (linux-main-modules-zfs-7.0.0-43-generic, module
version 2.4.1-1ubuntu5.1). After a file is truncated and then gets
blocks through copy_file_range, a read can return zeros instead of the
data. It shows up under load, the upstream report was a parallel kernel
build where a copied file read back with its first 128K zeroed. zpool
status stays clean, nothing in the logs.

Block cloning is on by default in 2.4.1 (zfs_bclone_enabled=1) and
coreutils cp uses copy_file_range, so a plain cp on a pool with
feature@block_cloning active goes through that code.

Upstream fixed it in 2.4.2 with 1644e2ffd ("Fix read corruption after
block clone after truncate", PR #18421). That fix had the opposite
problem, blocks freed after being cloned could read back the old cloned
data, which was fixed in 2.4.4 with 9bf75b4b1 ("Fix reads for blocks
freed after being cloned", PR #18724). Both are needed. Neither is in
the 2.4.1-1ubuntu5.1 changelog.

Workaround until a fixed package lands: set zfs_bclone_enabled=0 (echo 0
> /sys/module/zfs/parameters/zfs_bclone_enabled, and options zfs
zfs_bclone_enabled=0 in /etc/modprobe.d/zfs.conf + update-initramfs -u).
Blocks already cloned stay as they are.

We run noble with the 7.0 HWE kernel and a local 2.4.4 build, so we're
past it, but anyone on the stock module isn't.

https://github.com/openzfs/zfs/issues/18412
https://github.com/openzfs/zfs/pull/18421
https://github.com/openzfs/zfs/pull/18724

** Affects: zfs-linux (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175459

Title:
  zfs 2.4.1: reads can return zeros after copy_file_range on a truncated
  file (openzfs #18412), fix missing in resolute and the noble HWE 7.0
  kernels

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zfs-linux/+bug/2175459/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to