Page MenuHomeFreeBSD

Disallow zvol-backed ZFS pools
ClosedPublic

Authored by asomers on Jan 18 2016, 9:06 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 22 2023, 2:18 AM
Unknown Object (File)
Dec 20 2023, 1:42 AM
Unknown Object (File)
Aug 13 2023, 12:44 PM
Unknown Object (File)
Aug 3 2023, 2:36 AM
Unknown Object (File)
Jun 9 2023, 9:45 AM
Unknown Object (File)
Jun 2 2023, 1:22 AM
Unknown Object (File)
May 22 2023, 2:35 PM
Unknown Object (File)
Dec 29 2022, 5:59 AM
Subscribers

Details

Reviewers
delphij
smh
Group Reviewers
ZFS
Commits
rS294329: Disallow zvol-backed ZFS pools
Summary

Using zvols as backing devices for ZFS pools is fraught with panics and
deadlocks. For example, attempting to online a missing device in the
presence of a zvol can cause a panic when vdev_geom tastes the zvol.
Better to completely disable vdev_geom from ever opening a zvol. The
solution relies on setting a thread-local variable during
vdev_geom_open, and returning EOPNOTSUPP during zvol_open if that
thread-local variable is set.

Remove the check for MUTEX_HELD(&zfsdev_state_lock) in zvol_open. Its
intent was to prevent a recursive mutex acquisition panic. However, the
new check for the thread-local variable also fixes that problem.

Also, fix a panic in vdev_geom_taste_orphan. For an unknown reason,
this function was set to panic. But it can occur that a device
disappears during tasting, and it causes no problems to ignore this
departure.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

asomers retitled this revision from to Disallow zvol-backed ZFS pools.
asomers updated this object.
asomers edited the test plan for this revision. (Show Details)
asomers added reviewers: delphij, smh.
delphij edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Jan 18 2016, 9:36 PM

LGTM.

I think you told me that you also patched TrueNAS to disallow zvol-backed pools. Is that true? What approach did you take? If you're approach was better, we should take it instead.

I think you told me that you also patched TrueNAS to disallow zvol-backed pools. Is that true? What approach did you take? If you're approach was better, we should take it instead.

That's true but I like your approach better than mine (which was a brutal hack in my opinion), but just in case you want to take a look:

https://github.com/trueos/trueos/commit/bcf44b3c6615b8edf39c26e064410d5c2c8f633e

I think you told me that you also patched TrueNAS to disallow zvol-backed pools. Is that true? What approach did you take? If you're approach was better, we should take it instead.

That's true but I like your approach better than mine (which was a brutal hack in my opinion), but just in case you want to take a look:

https://github.com/trueos/trueos/commit/bcf44b3c6615b8edf39c26e064410d5c2c8f633e

Ahh, that's what I tried at first. But it doesn't work, as you've probably figured out, because other geom providers like glabel can be layered on top of zvol.

This revision was automatically updated to reflect the committed changes.