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

fix(driver): fix build of kmod on linux 6.10. #1884

Merged
merged 2 commits into from
Jul 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion driver/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1649,8 +1649,12 @@ static inline int drop_nostate_event(ppm_event_code event_type,
if (close_fd < 0 || close_fd >= fdt->max_fds ||
#if (LINUX_VERSION_CODE < KERNEL_VERSION(3, 4, 0))
!FD_ISSET(close_fd, fdt->open_fds)
#else
#elif (LINUX_VERSION_CODE < KERNEL_VERSION(6, 10, 0))
!fd_is_open(close_fd, fdt)
#else
// fd_is_open() was made file-local:
// https://github.com/torvalds/linux/commit/c4aab26253cd1f302279b8d6b5b66ccf1b120520
!test_bit(close_fd, fdt->open_fds)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the commit link also here in the code? Thank you!
just asking myself if under the hood all three 3 methods use !test_bit(close_fd, fdt->open_fds) if yes we could directly remove the ifdefs 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be too hard to check on any supported kernel unfortunately :/ I'd avoid relying on any assumption :D

#endif
) {
drop = true;
Expand Down
Loading