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

config: fix dequeue_signal check for kernels <4.20 #16666

Merged
merged 1 commit into from
Oct 21, 2024

Conversation

robn
Copy link
Member

@robn robn commented Oct 19, 2024

Motivation and Context

Compile failure against Linux <4.20.

This solves the same problem as #16662, but I prefer this way because it's one less configure check and easier to maintain, especially if this API changes again.

Closes #16662.

Description

Before 4.20, kernel_siginfo_t was just called siginfo_t. This was causing the
kthread_dequeue_signal_3arg_task check, which uses kernel_siginfo_t, to fail on
older kernels.

In d6b8c17, we started checking for the "new" three-arg dequeue_signal() by
testing for the "old" version. Because that test is explicitly using
kernel_siginfo_t, it would fail, leading to the build trying to use the new
three-arg version, which would then not comile.

This commit fixes that by avoiding checking for the old 3-arg dequeue_signal
entirely. Instead, we check for the new one, as well as the 4-arg form, and we
use the old form as a fallback. This way, we never have to test for it
explicitly, and once we're building HAVE_SIGINFO will make sure we get the
right kernel_siginfo_t for it, so everything works out nice.

How Has This Been Tested?

Compiled against kernels:

  • 6.12.0-rc2
  • 6.11
  • 6.10
  • 6.9
  • 6.8
  • 6.7
  • 6.6
  • 6.5
  • 6.4
  • 6.3
  • 6.1
  • 5.15
  • 5.10
  • 5.4
  • 4.19

and distros:

  • 5.4.0-84-generic (Ubuntu 18.04)
  • 5.13.0-30-generic (Ubuntu 20.04)
  • 5.15.0-25-generic (Ubuntu 22.04)
  • 6.8.0-31-generic (Ubuntu 24.04)
  • 4.18.0-348.7.1.el8_5.x86_64 (CentOS 8.4.2105)
  • 4.18.0-553.8.1.el8_10.x86_64 (Rocky 8.6)
  • 5.14.0-427.28.1.el9_4.x86_64 (Rocky 9)
  • 6.10.5-200.fc40.x86_64 (Fedora 40)

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Performance enhancement (non-breaking change which improves efficiency)
  • Code cleanup (non-breaking change which makes code smaller or more readable)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
  • Documentation (a change to man pages or other documentation)

Checklist:

Before 4.20, kernel_siginfo_t was just called siginfo_t. This was
causing the kthread_dequeue_signal_3arg_task check, which uses
kernel_siginfo_t, to fail on older kernels.

In d6b8c17, we started checking for the "new" three-arg
dequeue_signal() by testing for the "old" version. Because that test is
explicitly using kernel_siginfo_t, it would fail, leading to the build
trying to use the new three-arg version, which would then not comile.

This commit fixes that by avoiding checking for the old 3-arg
dequeue_signal entirely. Instead, we check for the new one, as well as
the 4-arg form, and we use the old form as a fallback. This way, we
never have to test for it explicitly, and once we're building
HAVE_SIGINFO will make sure we get the right kernel_siginfo_t for it, so
everything works out nice.

Original-patch-by: Finix <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
@behlendorf behlendorf added the Status: Accepted Ready to integrate (reviewed, tested) label Oct 20, 2024
@behlendorf behlendorf merged commit 21cba06 into openzfs:master Oct 21, 2024
18 of 20 checks passed
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Oct 21, 2024
Before 4.20, kernel_siginfo_t was just called siginfo_t. This was
causing the kthread_dequeue_signal_3arg_task check, which uses
kernel_siginfo_t, to fail on older kernels.

In d6b8c17, we started checking for the "new" three-arg
dequeue_signal() by testing for the "old" version. Because that test is
explicitly using kernel_siginfo_t, it would fail, leading to the build
trying to use the new three-arg version, which would then not compile.

This commit fixes that by avoiding checking for the old 3-arg
dequeue_signal entirely. Instead, we check for the new one, as well as
the 4-arg form, and we use the old form as a fallback. This way, we
never have to test for it explicitly, and once we're building
HAVE_SIGINFO will make sure we get the right kernel_siginfo_t for it, so
everything works out nice.

Original-patch-by: Finix <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16666
behlendorf pushed a commit to behlendorf/zfs that referenced this pull request Oct 21, 2024
Before 4.20, kernel_siginfo_t was just called siginfo_t. This was
causing the kthread_dequeue_signal_3arg_task check, which uses
kernel_siginfo_t, to fail on older kernels.

In d6b8c17, we started checking for the "new" three-arg
dequeue_signal() by testing for the "old" version. Because that test is
explicitly using kernel_siginfo_t, it would fail, leading to the build
trying to use the new three-arg version, which would then not compile.

This commit fixes that by avoiding checking for the old 3-arg
dequeue_signal entirely. Instead, we check for the new one, as well as
the 4-arg form, and we use the old form as a fallback. This way, we
never have to test for it explicitly, and once we're building
HAVE_SIGINFO will make sure we get the right kernel_siginfo_t for it, so
everything works out nice.

Original-patch-by: Finix <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16666
usaleem-ix pushed a commit to truenas/zfs that referenced this pull request Oct 28, 2024
Before 4.20, kernel_siginfo_t was just called siginfo_t. This was
causing the kthread_dequeue_signal_3arg_task check, which uses
kernel_siginfo_t, to fail on older kernels.

In d6b8c17, we started checking for the "new" three-arg
dequeue_signal() by testing for the "old" version. Because that test is
explicitly using kernel_siginfo_t, it would fail, leading to the build
trying to use the new three-arg version, which would then not compile.

This commit fixes that by avoiding checking for the old 3-arg
dequeue_signal entirely. Instead, we check for the new one, as well as
the 4-arg form, and we use the old form as a fallback. This way, we
never have to test for it explicitly, and once we're building
HAVE_SIGINFO will make sure we get the right kernel_siginfo_t for it, so
everything works out nice.

Original-patch-by: Finix <[email protected]>
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Rob Norris <[email protected]>
Closes openzfs#16666
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Accepted Ready to integrate (reviewed, tested)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants