[Bug 238112] Unable to create ZVOL

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Sat May 25 00:38:12 UTC 2019


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=238112

            Bug ID: 238112
           Summary: Unable to create ZVOL
           Product: Base System
           Version: 11.2-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs at FreeBSD.org
          Reporter: eugen at freebsd.org
                CC: allanjude at FreeBSD.org, fs at FreeBSD.org,
                    markj at FreeBSD.org, mav at FreeBSD.org

A colleague of mine is testing his set of virtual machines under FreeBSD
11.2-STABLE using bhyve (sysutils/vm-bhyve specifically) over GELI-encrypted
non-boot ZFS pool with multiple ZVOLs and faced a problem.

After GELI attached the pool, kernel part of ZFS tastes its internals and
writes to dmesg:

ZFS WARNING: Unable to create ZVOL
sata/vm/ws2019tmplENhalts/C at 20190524-225700-before-1st-reboot (error=63).

The dataset has recommended volmode=dev.

In sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zvol.c the function
zvol_create_minor() prepends mentioned long name of dataset with prefix "zvol/"
and calls make_dev_s() from sys/kern/kern_conf.c that is a wrapper for
make_dev_sv() failing with ENAMETOOLONG (63).

make_dev_sv() uses prep_devname() that returns this error if total length is
more than sizeof(dev->si_name) - 1 that equals to SPECNAMELEN defined to 63. So
ZVOL name length is effectively limited to 58 octets due to "zvol/" prefix.

Warning message quoted above is too cryptic for user and this limit is obscure
and seems to be FreeBSD-specific. Please change the code to test for
ENAMETOOLONG  and issue a warning describing the problem more clearly.

Also, consider replacing kernel printf() with more useful logging like log() so
the warning would hit syslog and get to /var/log/console.log (if enabled) and
not dmesg buffer only.

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


More information about the freebsd-bugs mailing list