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

unix: Don't fail on FreeBSD running ZFS #461

Merged
merged 2 commits into from
Mar 17, 2022

Conversation

chrissie-c
Copy link
Contributor

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!

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!
Copy link
Contributor

@kgaillot kgaillot left a 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
Copy link
Contributor

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);
Copy link
Contributor

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()

@kgaillot
Copy link
Contributor

looks good

@chrissie-c chrissie-c merged commit 2d03793 into ClusterLabs:main Mar 17, 2022
@chrissie-c
Copy link
Contributor Author

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!)

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.

2 participants