Bug 268338 - zfsdev_ioctl prints an error message if called with FIONBIO
Summary: zfsdev_ioctl prints an error message if called with FIONBIO
Status: Open
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 13.1-RELEASE
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-fs (Nobody)
URL:
Keywords: needs-qa
Depends on:
Blocks:
 
Reported: 2022-12-12 18:01 UTC by dfr
Modified: 2022-12-13 10:58 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description dfr 2022-12-12 18:01:54 UTC
While working on podman and buildah, I have noticed many messages logged on the console that look like this:

len 4 vecnum: 126 sizeof (zfs_cmd_t) 4528

After debugging this a little today, I discovered that this happens when something tries to set non-blocking i/o on a /dev/zfs filedescriptor which translates to a FIONBIO ioctl.

The zfs storage layer in for buildah and podman tries to detect whether zfs is available by opening /dev/zfs. The golang runtime libraries unconditionally try to set the descriptor into non-blocking mode causing the error message.

I can probably work around this in userland but it seems to me that the freebsd ZFS port should not print this message to console but instead return a suitable error. Currently it returns EINVAL after the printf which seems reasonable.
Comment 1 dfr 2022-12-13 08:56:58 UTC
Probably best if I get this fixed upstream. I'll open an issue in https://github.com/openzfs/zfs and make a PR.
Comment 2 dfr 2022-12-13 10:58:43 UTC
Upstream issue: https://github.com/openzfs/zfs/issues/14286