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

On Redhat 9.4/9.5 make ksmbd fails due to missing genhd.h for vfs.c #490

Open
besterino opened this issue Nov 24, 2024 · 8 comments
Open

Comments

@besterino
Copy link

Error:

make[1]: Entering directory '/usr/src/kernels/5.14.0-503.14.1.el9_5.x86_64'
CC [M] /home/test/ksmbd/unicode.o
CC [M] /home/test/ksmbd/auth.o
CC [M] /home/test/ksmbd/vfs.o
/home/test/ksmbd/vfs.c:19:10: fatal error: linux/genhd.h: No such file or directory
19 | #include <linux/genhd.h>
| ^~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [scripts/Makefile.build:249: /home/bestie/ksmbd/vfs.o] Error 1
make[1]: *** [Makefile:1944: /home/bestie/ksmbd] Error 2
make[1]: Leaving directory '/usr/src/kernels/5.14.0-503.14.1.el9_5.x86_64'
make: *** [Makefile:47: all] Error 2

Seems genhd.h is no longer included but still expected for this particular kernel?

uname -r:
5.14.0-503.14.1.el9_5.x86_64

@hireworksltd
Copy link
Contributor

hireworksltd commented Nov 24, 2024

Looks likes genhd.h was removed in 5.19.8 (though not sure why you're seeing this in 5.14, guess RH specific)

see: https://lore.kernel.org/all/9bb3f4c6-4e21-e1d7-b4e1-f65d273cd3f8@nvidia.com/t/

try changing it for <linux/blkdev.h>

Cheers,
Jon

@besterino
Copy link
Author

I tried blkdev.h instead of genhd.h, but that threw a lot of (other) errors, so that is not really a fix.

@capnbb
Copy link

capnbb commented Jan 30, 2025

I'm sure your busy, but forgive the bump as a buildable ksmbd kernel module on a RHEL clone would be very, very useful:

We see exactly the same problem on Alma 9.5 with kernel 5.14.0-503.21.1.el9_5.x86_64

likewise changing genhd.h for blkdev.h in vfs.c threw lots of other errors.

any work around greatly appreciated.

Jake

@namjaejeon
Copy link
Owner

@capnbb I have removed genhd header in #master branch. Please check it.

@capnbb
Copy link

capnbb commented Feb 3, 2025

Thank you so much @namjaejeon, but I'm sorry to say this still doesn't fix our build issue.

I've given details next to your Commit 4c27c3b

4c27c3b

again, many thanks

Jake

@namjaejeon
Copy link
Owner

Although kernel version of Redhat 9.4/9.5 is not 5.14 kernel, they didn't increase their kernel version.
They updated kernel source without changing kernel version.

@capnbb
Copy link

capnbb commented Feb 4, 2025

The mismatch is due to Redhat backporting features and fixes to the kernel, so it ends up as a hybrid that never exactly matches the official kernel. The backport kernels work for lots of dkms kernel modules, but breaks others…😟

I'll try enabling the elrepo-kernel, as this gives us access to standard kernels which ksmbd should build against...

Thanks again

@capnbb
Copy link

capnbb commented Feb 7, 2025

Quick update, the current LTS kernel for Alma 9.5 (kernel-lt-6.1.128-1.el9 ) doesn't build ksmbd

make gives an "error: redefinition of ‘is_dot_dotdot’"

However, commenting the offending section out of vfs.c allows the build to complete:

diff vfs.c.orig vfs.c
2663,2667c2663,2667
< static inline bool is_dot_dotdot(const char *name, size_t len)
< {
< return len && unlikely(name[0] == '.') &&
< (len == 1 || (len == 2 && name[1] == '.'));
< }

//static inline bool is_dot_dotdot(const char *name, size_t len)
//{
// return len && unlikely(name[0] == '.') &&
// (len == 1 || (len == 2 && name[1] == '.'));
//}

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

No branches or pull requests

4 participants