zfs icon indicating copy to clipboard operation
zfs copied to clipboard

config: fix dequeue_signal check for kernels <4.20

Open robn opened this issue 1 year ago • 0 comments

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 d6b8c17f1, 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

  • [x] 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:

  • [x] My code follows the OpenZFS code style requirements.
  • [ ] I have updated the documentation accordingly.
  • [x] I have read the contributing document.
  • [ ] I have added tests to cover my changes.
  • [ ] I have run the ZFS Test Suite with this change applied.
  • [x] All commit messages are properly formatted and contain Signed-off-by.

robn avatar Oct 19 '24 11:10 robn