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)
Oct 2 2024, 11:01 AM
Unknown Object (File)
Oct 1 2024, 5:11 AM
Unknown Object (File)
Oct 1 2024, 3:49 AM
Unknown Object (File)
Sep 30 2024, 8:03 PM
Unknown Object (File)
Sep 23 2024, 12:33 PM
Unknown Object (File)
Sep 23 2024, 11:53 AM
Unknown Object (File)
Sep 22 2024, 1:16 AM
Unknown Object (File)
Sep 21 2024, 5:17 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.