Page MenuHomeFreeBSD

rework how ZVOLs are updated in response to DSL operations
ClosedPublic

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

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
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 29641
Build 27499: arc lint + arc unit

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.