Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use unix.Open instead of os.OpenFile for /dev/zfs #1450

Merged
merged 2 commits into from Dec 13, 2022

Conversation

dfr
Copy link
Contributor

@dfr dfr commented Dec 13, 2022

The code is testing that its possible to open the /dev/zfs device. Using os.OpenFile does other things to the open file, including trying to set non-blocking i/o which triggers a cryptic error message on the console on FreeBSD.

I plan to fix that upstream in openzfs (openzfs/zfs#14286) but in the meantime, using unix.Open instead of os.OpenFile avoids the problem.

This was causing a bash error message:

	.../test/helpers.bash: line 10: [: : integer expression expected

Signed-off-by: Doug Rabson <dfr@rabson.org>
The alternative os.OpenFile internally tries to enable non-blocking i/o
on the descriptor which on FreeBSD has the side effect of printing a
cryptic error message on the console
(openzfs/zfs#14286).

Signed-off-by: Doug Rabson <dfr@rabson.org>
@rhatdan
Copy link
Member

rhatdan commented Dec 13, 2022

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@giuseppe giuseppe merged commit 9587fda into containers:main Dec 13, 2022
@dfr dfr deleted the freebsd-zfs branch December 13, 2022 15:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants