[Bug 262189] ZFS volume not showing up in /dev/zvol when 1 CPU

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 28 Feb 2022 09:12:29 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=262189

--- Comment #9 from Janis <zedupsys@gmail.com> ---
Now i tried to test the same script with sysctl vfs.zfs.vol.mode=2, single CPU,
single core. Added sparse option, since it does not reserve space and seems not
to influence the bug.


sysctl vfs.zfs.vol.mode=2
.. loop ..
zfs create -o volmode=dev -s -V 1G $name_pool/data$i
..

All ZVOLs show up as would be expected from "zfs create" with
vfs.zfs.vol.mode=1 as well.


The interesting thing is that with
sysctl vfs.zfs.vol.mode=2
.. loop ..
zfs create -o volmode=geom -s -V 1G $name_pool/dataG$i
..

All ZVOLs showed up. I somewhat expected this to fail, since default mode was
set to DEV, and i thought that create-destroy stuff as mentioned in comment #2
would mess things up, but no, it did not.


But when i switch sysctl value back
sysctl vfs.zfs.vol.mode=1
.. loop ..
zfs create -o volmode=dev -s -V 1G $name_pool/dataD$i
..

No ZVOL shows up in /dev/zvol


Based on this, it seems that actually it would be better if default value is
DEV, since then in both "zfs create" calls, ZVOLs show up (bug does not
manifest itself). So to trick away this bug, it could be possible to set
vfs.zfs.vol.mode=2(DEV) as default and for "zfs create" command to auto-fill
volmode=geom if volmode is not specified. I would not like this to be a
solution, since that does not fix the bug, it just masks it, which might
manifest itself in different cases anyways.

It seems that value change vfs.zfs.vol.mode=2 might help in some systems to
minimize problems with ZVOLs whose type is DEV.


So it seems that second part of comment #2 might be closer where the bug comes
from. What i did not get though is, why then with vfs.zfs.vol.mode=2; zfs
create volmode=geom did not fail? Does it take different path then not the
create-destroy-create?

-- 
You are receiving this mail because:
You are the assignee for the bug.