Skip to content

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

Merged
chrissie-c merged 2 commits intoClusterLabs:mainfrom
chrissie-c:zfs-being-annoying
Mar 17, 2022
Merged

unix: Don't fail on FreeBSD running ZFS#461
chrissie-c merged 2 commits intoClusterLabs:mainfrom
chrissie-c:zfs-being-annoying

Conversation

@chrissie-c
Copy link
Copy Markdown
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
Copy Markdown

@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
Copy Markdown

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
Copy Markdown

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
Copy Markdown

looks good

@chrissie-c chrissie-c merged commit 2d03793 into ClusterLabs:main Mar 17, 2022
@chrissie-c
Copy link
Copy Markdown
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