Page MenuHomeFreeBSD

rework how ZVOLs are updated in response to DSL operations
ClosedPublic

Authored by avg on Feb 3 2020, 12:52 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Oct 24, 6:27 AM
Unknown Object (File)
Oct 2 2024, 1:24 AM
Unknown Object (File)
Oct 1 2024, 7:11 AM
Unknown Object (File)
Oct 1 2024, 3:07 AM
Unknown Object (File)
Sep 30 2024, 8:10 PM
Unknown Object (File)
Sep 30 2024, 2:19 PM
Unknown Object (File)
Sep 30 2024, 1:50 AM
Unknown Object (File)
Sep 27 2024, 5:56 AM
Subscribers

Details

Summary

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 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203864 .

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:

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

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
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
ZFS_IOC_TMP_SNAPSHOT).

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.