Change 294329 removed the ability to build ZFS pools that are backed by zvols,
because having that ability (even if it's not used) leads to deadlocks. By
popular demand, I'm adding an off-by-default sysctl to reenable that ability.
Details
- Reviewers
delphij se • lidl - Commits
- rS295045: Add a sysctl to allow ZFS pools backed by zvols
Create a mirrored pool named foo
Create a pool named bar, and create a zvol on it
Remove one of foo's disks
In one terminal, do "zpool status foo" in a while loop
In another terminal, do "zpool online foo <removed disk's guid>" in a while loop
Verify that no deadlocks result after a few minutes, then kill both loops
Try to create a zpool on bar's zvol. It should fail.
Do "sysctl vfs.zfs.vol.recursive=1".
Try to create a zpool on bar's zvol. It should succeed.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 2206 Build 2215: arc lint + arc unit
Event Timeline
I built a kernel with this patch in it.
I ran my script without setting the sysctl. It failed, as expected.
I set the sysctl, and re-ran my script. It succeeded.
I am satisfied with this solution.
UPDATING | ||
---|---|---|
36 | How about "That feature has never worked safely; it's always been prone to deadlocks."? | |
sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c | ||
138 | Nothing will happen, since the knob only affects tasting. If you have an active pool on zvols and you switch the knob off, I/O to the pool will still work. You can even export the pool. But then you won't be able to import it again, and you won't be able to do operations like offline a zvol vdev and online it, or replace a zvol vdev with another zvol. |