Page MenuHomeFreeBSD

rework how ZVOLs are updated in response to DSL operations

Authored by avg on Feb 3 2020, 12:52 PM.



With this change all ZVOL updates are initiated from the SPA sync context
instead of a mix of the sync and open contexts. The updates are queued to
be applied by a dedicated thread in the original order. This should ensure
that ZVOLs always accurately reflect the corresponding datasets. ZFS ioctl
operations wait on the mentioned thread to complete its work. Thus, the
illusion of the synchronous ZVOL update is preserved. At the same time, the
SPA sync thread never blocks on ZVOL related operations avoiding problems
like reported in .

This change is based on earlier work in the same direction: D7179 and
D14669. D7179 tried to perform ZVOL operations in the open context and that
opened races between them. D14669 uses a design very similar to this change
but with different implementation details.

This change also heavily borrows from similar code in ZoL, but there are many
differences. See:

This change also fixes a bug with ZVOL and VFS rename in
dsl_dataset_promote_sync where 'oldname' was not properly set (since

Diff Detail

rS FreeBSD src repository - subversion
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Add Actifio copyright to files where I made verbatim copies of the
corresponding code from ZoL.

This revision is now accepted and ready to land.Feb 12 2020, 4:46 PM
This revision now requires review to proceed.Feb 27 2020, 2:30 PM

Move creation of a "minor" from dsl_dataset_snapshot_sync_impl() to
dsl_dataset_snapshot_sync(). The former is also used by
dsl_dataset_snapshot_tmp_sync() and we do not need to create minors for
temporary snapshots. They are used only by zfs diff against a filesystem (via

This revision was not accepted when it landed; it landed in state Needs Review.Jun 11 2020, 10:41 AM
This revision was automatically updated to reflect the committed changes.