-
Notifications
You must be signed in to change notification settings - Fork 97
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
unix: Don't fail on FreeBSD running ZFS #461
Conversation
ZFS doesn't support posix_fallocate() so libqb IPC or RB would always fail with EINVAL. As there seems to be no prospect of a more useful return code, trap it in a QB_BSD #ifdef. That way if we do have actual errors in the posix_fallocate() call the Linux tests should still find them. Also, stick a small sleep in the test_ipc_disconnect_after_created test to allow the server to shutdown before killing it with SIGTERM and causing a test failure. all the other uses of it seem to have this sleep!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
} else if (res == EINVAL) { /* posix_fallocate() fails on ZFS | ||
https://lists.freebsd.org/pipermail/freebsd-current/2018-February/068448.html */ | ||
qb_util_log(LOG_DEBUG, "posix_fallocate returned EINVAL - running on ZFS?"); | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another possibility would be to do what's currently in the #else block if posix_fallocate() fails, as a fallback (regardless of platform). Not sure if that's better though ...
qb_ipcc_disconnect(conn); | ||
sleep(1); /* Give it time to stop */ | ||
kill_server(pid); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you want to make sure this doesn't get overlooked, you could make the sleep time an argument to kill_server()
looks good |
Thanks Ken. if you get time, could you also please have a look at #455 - it's been hanging around for a while and keeps getting overlooked, but I think we should be testing this feature as I believe it's till used in container (and if not, we can remove it!) |
ZFS doesn't support posix_fallocate() so libqb IPC or RB would
always fail with EINVAL.
As there seems to be no prospect of a more useful return code,
trap it in a QB_BSD #ifdef. That way if we do have actual errors
in the posix_fallocate() call the Linux tests should still find them.
Also, stick a small sleep in the test_ipc_disconnect_after_created
test to allow the server to shutdown before killing it with SIGTERM
and causing a test failure. all the other uses of it seem to have this
sleep!