<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src, branch vendor/openzfs/master</title>
<subtitle>FreeBSD source tree</subtitle>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<entry>
<title>Fix read corruption after block clone after truncate</title>
<updated>2026-04-15T21:51:53+00:00</updated>
<author>
<name>Gary Guo</name>
<email>gary@garyguo.net</email>
</author>
<published>2026-04-15T21:51:53+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1644e2ffd2640fa3e2c191ceaf048a5fc8399493'/>
<id>1644e2ffd2640fa3e2c191ceaf048a5fc8399493</id>
<content type='text'>
When copy_file_range overwrites a recent truncation, subsequent reads
can incorrectly determine that it is read hole instead of reading the
cloned blocks.

This can happen when the following conditions are met:
- Truncate adds blkid to dn_free_ranges
- A new TXG is created
- copy_file_range calls dmu_brt_clone which override the block pointer
  and set DB_NOFILL
- Subsequent read, given DB_NOFILL, hits dbuf_read_impl and
  dbuf_read_hole
- dbuf_read_hole calls dnode_block_freed, which returns TRUE because the
  truncated blkids are still in dn_free_ranges

This will not happen if the clone and truncate are in the same TXG,
because the block clone would update the current TXG's dn_free_ranges,
which is why this bug only triggers under high IO load (such as
compilation).

Fix this by skipping the dnode_block_freed call if the block is
overridden. The fix shouldn't cause an issue when the cloned block is
subsequently freed in later TXGs, as dbuf_undirty would remove the
override.

This requires a dedicated test program as it is much harder to trigger
with scripts (this needs to generate a lot of I/O in short period of
time for the bug to trigger reliably).

Assisted-by: Gemini:gemini-3.1-pro
Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Tony Hutter &lt;hutter2@llnl.gov&gt;
Signed-off-by: Gary Guo &lt;gary@kernel.org&gt;
Closes #18412
Closes #18421</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When copy_file_range overwrites a recent truncation, subsequent reads
can incorrectly determine that it is read hole instead of reading the
cloned blocks.

This can happen when the following conditions are met:
- Truncate adds blkid to dn_free_ranges
- A new TXG is created
- copy_file_range calls dmu_brt_clone which override the block pointer
  and set DB_NOFILL
- Subsequent read, given DB_NOFILL, hits dbuf_read_impl and
  dbuf_read_hole
- dbuf_read_hole calls dnode_block_freed, which returns TRUE because the
  truncated blkids are still in dn_free_ranges

This will not happen if the clone and truncate are in the same TXG,
because the block clone would update the current TXG's dn_free_ranges,
which is why this bug only triggers under high IO load (such as
compilation).

Fix this by skipping the dnode_block_freed call if the block is
overridden. The fix shouldn't cause an issue when the cloned block is
subsequently freed in later TXGs, as dbuf_undirty would remove the
override.

This requires a dedicated test program as it is much harder to trigger
with scripts (this needs to generate a lot of I/O in short period of
time for the bug to trigger reliably).

Assisted-by: Gemini:gemini-3.1-pro
Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Tony Hutter &lt;hutter2@llnl.gov&gt;
Signed-off-by: Gary Guo &lt;gary@kernel.org&gt;
Closes #18412
Closes #18421</pre>
</div>
</content>
</entry>
<entry>
<title>deb.am: propagate build errors in native-deb targets</title>
<updated>2026-04-15T21:50:20+00:00</updated>
<author>
<name>Christos Longros</name>
<email>98426896+chrislongros@users.noreply.github.com</email>
</author>
<published>2026-04-15T21:50:20+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=4b4ae48f9a286ac536679d68dce9aa46d126249b'/>
<id>4b4ae48f9a286ac536679d68dce9aa46d126249b</id>
<content type='text'>
Replace semicolons with &amp;&amp; so build failures are not masked by the
subsequent lockfile cleanup.  Use trap to ensure the lockfile is
removed on both success and failure.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Signed-off-by: Christos Longros &lt;chris.longros@gmail.com&gt;
Closes #18206
Closes #18424</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Replace semicolons with &amp;&amp; so build failures are not masked by the
subsequent lockfile cleanup.  Use trap to ensure the lockfile is
removed on both success and failure.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Signed-off-by: Christos Longros &lt;chris.longros@gmail.com&gt;
Closes #18206
Closes #18424</pre>
</div>
</content>
</entry>
<entry>
<title>Use AVL tree lookup in zfsctl_snapdir_vget for mounted snapshots</title>
<updated>2026-04-15T21:49:22+00:00</updated>
<author>
<name>Ameer Hamza</name>
<email>ahamza@ixsystems.com</email>
</author>
<published>2026-04-15T21:49:22+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=01e2a968396316d2ca4ce7d934c76802c7e896d4'/>
<id>01e2a968396316d2ca4ce7d934c76802c7e896d4</id>
<content type='text'>
zfsctl_snapdir_vget resolves NFS file handles for snapshot directory
entries by calling zfsctl_snapshot_path_objset, which iterates all
snapshots via dmu_snapshot_list_next to find the matching objsetid.
With many snapshots this linear scan is expensive.

For snapshots that have been previously mounted, the path is already
cached in the in-memory AVL tree. Check the tree first with
zfsctl_snapshot_find_by_objsetid and fall back to the on-disk scan
only when the entry is not found.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Tony Hutter &lt;hutter2@llnl.gov&gt;
Signed-off-by: Ameer Hamza &lt;ahamza@ixsystems.com&gt;
Closes #18429</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
zfsctl_snapdir_vget resolves NFS file handles for snapshot directory
entries by calling zfsctl_snapshot_path_objset, which iterates all
snapshots via dmu_snapshot_list_next to find the matching objsetid.
With many snapshots this linear scan is expensive.

For snapshots that have been previously mounted, the path is already
cached in the in-memory AVL tree. Check the tree first with
zfsctl_snapshot_find_by_objsetid and fall back to the on-disk scan
only when the entry is not found.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Tony Hutter &lt;hutter2@llnl.gov&gt;
Signed-off-by: Ameer Hamza &lt;ahamza@ixsystems.com&gt;
Closes #18429</pre>
</div>
</content>
</entry>
<entry>
<title>draid: fix cksum errors after rebuild with degraded disks</title>
<updated>2026-04-15T21:48:00+00:00</updated>
<author>
<name>Andriy Tkachuk</name>
<email>andriy.tkachuk@gmail.com</email>
</author>
<published>2026-04-15T21:48:00+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=2abf469be5988ab8ba7951ec17dd93cd56c29bff'/>
<id>2abf469be5988ab8ba7951ec17dd93cd56c29bff</id>
<content type='text'>
Currently, when more than nparity disks get faulted during the
rebuild, only first nparity disks would go to faulted state, and
all the remaining disks would go to degraded state. When a hot
spare is attached to that degraded disk for rebuild creating the
spare mirror, only that hot spare is getting rebuilt, but not the
degraded device. So when later during scrub some other attached
draid spare happens to map to that spare, it will end up with
cksum error.

Moreover, if the user clears the degraded disk from errors, the
data won't be resilvered to it, hot spare will be detached almost
immediately and the data that was resilvered only to it will be
lost.

Solution: write to all mirrored devices during rebuild, similar
to traditional/healing resilvering, but only if we can verify
the integrity of the data, or when it's the draid spare we are
writing to, in which case we are writing to a reserved spare
space, and there is no danger to overwrite any good data.

The argument that writing only to rebuilding draid spare vdev is
faster than writing to normal device doesn't hold since, at a
specific offset being rebuilt, draid spare will be mapped to a
normal device anyway.

redundancy_draid_degraded2 automation test is added also to
cover the scenario.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Signed-off-by: Andriy Tkachuk &lt;atkachuk@wasabi.com&gt;
Closes #18414</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Currently, when more than nparity disks get faulted during the
rebuild, only first nparity disks would go to faulted state, and
all the remaining disks would go to degraded state. When a hot
spare is attached to that degraded disk for rebuild creating the
spare mirror, only that hot spare is getting rebuilt, but not the
degraded device. So when later during scrub some other attached
draid spare happens to map to that spare, it will end up with
cksum error.

Moreover, if the user clears the degraded disk from errors, the
data won't be resilvered to it, hot spare will be detached almost
immediately and the data that was resilvered only to it will be
lost.

Solution: write to all mirrored devices during rebuild, similar
to traditional/healing resilvering, but only if we can verify
the integrity of the data, or when it's the draid spare we are
writing to, in which case we are writing to a reserved spare
space, and there is no danger to overwrite any good data.

The argument that writing only to rebuilding draid spare vdev is
faster than writing to normal device doesn't hold since, at a
specific offset being rebuilt, draid spare will be mapped to a
normal device anyway.

redundancy_draid_degraded2 automation test is added also to
cover the scenario.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Signed-off-by: Andriy Tkachuk &lt;atkachuk@wasabi.com&gt;
Closes #18414</pre>
</div>
</content>
</entry>
<entry>
<title>CI: Disable ZIP file artifacts, update versions</title>
<updated>2026-04-14T20:20:46+00:00</updated>
<author>
<name>Tony Hutter</name>
<email>hutter2@llnl.gov</email>
</author>
<published>2026-04-14T20:20:46+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6692b6e28a2f4fe241bc8e327aa9e59aaeb41edd'/>
<id>6692b6e28a2f4fe241bc8e327aa9e59aaeb41edd</id>
<content type='text'>
The GH artifacts action now lets you disable auto-zipping your
artifacts.  Previously, GH would always automatically put your
artifacts in a ZIP file.  This is annoying when your artifacts
are already in a tarball.

Also update the following action versions

checkout:		v4 -&gt; v6
upload-artifact:	v4 -&gt; v7
download-artifact:	v4 -&gt; v8

Lastly, fix a issue where zfs-qmeu-packages now needs to power
cycle the VM.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: George Melikov &lt;mail@gmelikov.ru&gt;
Signed-off-by: Tony Hutter &lt;hutter2@llnl.gov&gt;
Closes #18411</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The GH artifacts action now lets you disable auto-zipping your
artifacts.  Previously, GH would always automatically put your
artifacts in a ZIP file.  This is annoying when your artifacts
are already in a tarball.

Also update the following action versions

checkout:		v4 -&gt; v6
upload-artifact:	v4 -&gt; v7
download-artifact:	v4 -&gt; v8

Lastly, fix a issue where zfs-qmeu-packages now needs to power
cycle the VM.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: George Melikov &lt;mail@gmelikov.ru&gt;
Signed-off-by: Tony Hutter &lt;hutter2@llnl.gov&gt;
Closes #18411</pre>
</div>
</content>
</entry>
<entry>
<title>Fix snapshot automount deadlock during concurrent zfs recv</title>
<updated>2026-04-08T23:42:58+00:00</updated>
<author>
<name>Ameer Hamza</name>
<email>ahamza@ixsystems.com</email>
</author>
<published>2026-04-08T09:32:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=9bf1a720f6f7bfcacb35874919f9cf90464bd095'/>
<id>9bf1a720f6f7bfcacb35874919f9cf90464bd095</id>
<content type='text'>
zfsctl_snapshot_mount() holds z_teardown_lock(R) across
call_usermodehelper(), which spawns a mount process that needs
namespace_sem(W) via move_mount. Reading /proc/self/mountinfo holds
namespace_sem(R) and needs z_teardown_lock(R) via zpl_show_devname.
When zfs_suspend_fs (from zfs recv or zfs rollback) queues
z_teardown_lock(W), the rrwlock blocks new readers, completing the
deadlock cycle.

Fix by releasing z_teardown_lock(R) after gathering the dataset name
and mount path, before any blocking operation. Everything after the
release operates on local string copies or uses its own
synchronization. The parent zfsvfs pointer remains valid because the
caller holds a path reference to the automount trigger dentry.

Releasing the lock allows zfs_suspend_fs to proceed concurrently
with the mount helper, so dmu_objset_hold in zpl_get_tree can
transiently fail with ENOENT during the clone swap. The mount
helper fails, EISDIR is returned, and the VFS falls back to the
ctldir stub (empty directory) until the next access retries.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Reviewed-by: Rob Norris &lt;robn@despairlabs.com&gt;
Signed-off-by: Ameer Hamza &lt;ahamza@ixsystems.com&gt;
Closes #18415
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
zfsctl_snapshot_mount() holds z_teardown_lock(R) across
call_usermodehelper(), which spawns a mount process that needs
namespace_sem(W) via move_mount. Reading /proc/self/mountinfo holds
namespace_sem(R) and needs z_teardown_lock(R) via zpl_show_devname.
When zfs_suspend_fs (from zfs recv or zfs rollback) queues
z_teardown_lock(W), the rrwlock blocks new readers, completing the
deadlock cycle.

Fix by releasing z_teardown_lock(R) after gathering the dataset name
and mount path, before any blocking operation. Everything after the
release operates on local string copies or uses its own
synchronization. The parent zfsvfs pointer remains valid because the
caller holds a path reference to the automount trigger dentry.

Releasing the lock allows zfs_suspend_fs to proceed concurrently
with the mount helper, so dmu_objset_hold in zpl_get_tree can
transiently fail with ENOENT during the clone swap. The mount
helper fails, EISDIR is returned, and the VFS falls back to the
ctldir stub (empty directory) until the next access retries.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Reviewed-by: Rob Norris &lt;robn@despairlabs.com&gt;
Signed-off-by: Ameer Hamza &lt;ahamza@ixsystems.com&gt;
Closes #18415
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix options memory leak in zfsctl_snapshot_mount</title>
<updated>2026-04-08T23:42:23+00:00</updated>
<author>
<name>Ameer Hamza</name>
<email>ahamza@ixsystems.com</email>
</author>
<published>2026-04-08T09:22:41+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a616ba811c42af5f79fe8bee3ef7c5858b0c7b8c'/>
<id>a616ba811c42af5f79fe8bee3ef7c5858b0c7b8c</id>
<content type='text'>
Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Reviewed-by: Rob Norris &lt;robn@despairlabs.com&gt;
Signed-off-by: Ameer Hamza &lt;ahamza@ixsystems.com&gt;
Closes #18415
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Reviewed-by: Rob Norris &lt;robn@despairlabs.com&gt;
Signed-off-by: Ameer Hamza &lt;ahamza@ixsystems.com&gt;
Closes #18415
</pre>
</div>
</content>
</entry>
<entry>
<title>zvol: Fix uses of uninitialized variables in zvol_rename_minors_impl()</title>
<updated>2026-04-08T21:15:44+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-02-12T22:10:36+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=943a05528494b2f4585541089606796476fb229e'/>
<id>943a05528494b2f4585541089606796476fb229e</id>
<content type='text'>
Reported-by: GitHub Copilot
Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Signed-off-by: Mark Johnston &lt;markj@FreeBSD.org&gt;
Closes #18191
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reported-by: GitHub Copilot
Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Signed-off-by: Mark Johnston &lt;markj@FreeBSD.org&gt;
Closes #18191
</pre>
</div>
</content>
</entry>
<entry>
<title>zvol: Hold the zvol state writer lock when renaming</title>
<updated>2026-04-08T21:15:44+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-02-09T14:54:44+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d7b8eef9d281f6831ac7d9cb27362509ec434fb2'/>
<id>d7b8eef9d281f6831ac7d9cb27362509ec434fb2</id>
<content type='text'>
Otherwise nothing serializes updates to the global zvol hash table.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Signed-off-by: Mark Johnston &lt;markj@FreeBSD.org&gt;
Closes #18191
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Otherwise nothing serializes updates to the global zvol hash table.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Signed-off-by: Mark Johnston &lt;markj@FreeBSD.org&gt;
Closes #18191
</pre>
</div>
</content>
</entry>
<entry>
<title>Make zvol_set_common() block until the operation has completed</title>
<updated>2026-04-08T21:15:27+00:00</updated>
<author>
<name>Mark Johnston</name>
<email>markj@FreeBSD.org</email>
</author>
<published>2026-02-02T01:55:04+00:00</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=d736868672cb3df197d2ddcfef29ac14edf4ee20'/>
<id>d736868672cb3df197d2ddcfef29ac14edf4ee20</id>
<content type='text'>
This is motivated by a FreeBSD AIO test case which create a zvol with -o
volmode=dev, then immediately tries to open the zvol device file.  The
open occasionally fails with ENOENT.

When a zvol is created without the volmode setting, zvol_create_minors()
blocks until the task is finished, at which point OS-dependent code will
have created a device file.  However, zvol_set_common() may cause the
device file to be destroyed and re-created, at least on FreeBSD, if the
voltype switches from GEOM to DEV.  In this case, we do not block
waiting for the operation to finish, causing the test failure.

Fix the problem by making zvol_set_common() block until the operation
has finished.  In FreeBSD zvol code, use g_waitidle() to block until
asynchronous GEOM operations are done.  This fixes a secondary race
where zvol_os_remove_minor() does not block until the zvol device file
is removed, and the subsequent zvol_os_create_minor() fails because the
(to-be-destroyed) device file already exists.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Signed-off-by: Mark Johnston &lt;markj@FreeBSD.org&gt;
Closes #18191
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is motivated by a FreeBSD AIO test case which create a zvol with -o
volmode=dev, then immediately tries to open the zvol device file.  The
open occasionally fails with ENOENT.

When a zvol is created without the volmode setting, zvol_create_minors()
blocks until the task is finished, at which point OS-dependent code will
have created a device file.  However, zvol_set_common() may cause the
device file to be destroyed and re-created, at least on FreeBSD, if the
voltype switches from GEOM to DEV.  In this case, we do not block
waiting for the operation to finish, causing the test failure.

Fix the problem by making zvol_set_common() block until the operation
has finished.  In FreeBSD zvol code, use g_waitidle() to block until
asynchronous GEOM operations are done.  This fixes a secondary race
where zvol_os_remove_minor() does not block until the zvol device file
is removed, and the subsequent zvol_os_create_minor() fails because the
(to-be-destroyed) device file already exists.

Reviewed-by: Brian Behlendorf &lt;behlendorf1@llnl.gov&gt;
Reviewed-by: Alexander Motin &lt;alexander.motin@TrueNAS.com&gt;
Signed-off-by: Mark Johnston &lt;markj@FreeBSD.org&gt;
Closes #18191
</pre>
</div>
</content>
</entry>
</feed>
