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

failure to include abd_os.h when installed from libzfs5-devel rpm #16940

Open
defaziogiancarlo opened this issue Jan 9, 2025 · 3 comments
Open
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@defaziogiancarlo
Copy link
Contributor

System information

Type Version/Name
Distribution Name TOSS
Distribution Version 4
Kernel Version 4.18.0-553.33
Architecture x86_64
OpenZFS Version zfs-2.2.7_1llnl-1 https://github.com/LLNL/zfs/tree/zfs-2.2.7_1llnl

Describe the problem you're observing

When building lustre 2.15.6 against zfs 2.2.7 I get the error:

In file included from /usr/include/libzfs/sys/zio_compress.h:33,
                 from /usr/include/libzfs/sys/dmu.h:50,
                 from /usr/include/libzfs/sys/spa.h:46,
                 from libmount_utils_zfs.c:32:
/usr/include/libzfs/sys/abd.h:33:10: fatal error: sys/abd_os.h: No such file or directory
 #include <sys/abd_os.h>
          ^~~~~~~~~~~~~~

For abd_os.h the only include I see is in abd.h and is prefixed by sys: #include <sys/abd_os.h>.
In the source tree the path to abd_os.h is always prefixed by sys:

(gopher12):zfs$ find . -name abd_os.h
./include/os/freebsd/zfs/sys/abd_os.h
./include/os/linux/zfs/sys/abd_os.h
./lib/libzpool/include/sys/abd_os.h

However the libzfs5-devel rpm installs abd_os.h at:

[root@gopher12:zfs-2.2.7-rpms]# rpm -ql libzfs5-devel-2.2.7_1llnl-1.t4.x86_64.rpm | grep abd_os\.h
/usr/include/libzpool/abd_os.h

NOTE: lustre doesn't normally have "-I /usr/include/libzpool" but it is being used in this case

I think that libzfs5-devel should install abd_os.h at /usr/include/libzpool/sys/abd_os.h or maybe /usr/include/libzfs/sys/abd_os.h, otherwise the #include in abd.h will fail.

Describe how to reproduce the problem

install libzfs5-devel and attempt to include spa.h

[root@gopher12:zfs-2.2.7-rpms]# rpm -q libzfs5-devel
libzfs5-devel-2.2.7_1llnl-1.t4.x86_64pm
[root@gopher12:zfs-2.2.7-rpms]# cat ~/test_include_spa.c
#include <sys/spa.h>

int main() {
  return 0;
}
[root@gopher12:zfs-2.2.7-rpms]# gcc -Wall -I /usr/include/libspl -I /usr/include/libzfs -I /usr/include/libzpool -o test_include_spa ~/test_include_spa.c
In file included from /usr/include/libzfs/sys/zio_compress.h:33,
                 from /usr/include/libzfs/sys/dmu.h:50,
                 from /usr/include/libzfs/sys/spa.h:46,
                 from /root/test_include_spa.c:1:
/usr/include/libzfs/sys/abd.h:33:10: fatal error: sys/abd_os.h: No such file or directory
 #include <sys/abd_os.h>
          ^~~~~~~~~~~~~~
@defaziogiancarlo defaziogiancarlo added the Type: Defect Incorrect behavior (e.g. crash, hang) label Jan 9, 2025
@tonyhutter
Copy link
Contributor

I can confirm this affects libzfs6-devel on master as well:

$ gcc -Wall -I /usr/include/libspl -I /usr/include/libzfs -I /usr/include/libzpool main.c -o main
In file included from /usr/include/libzfs/sys/zio_compress.h:34,
                 from /usr/include/libzfs/sys/dmu.h:50,
                 from /usr/include/libzfs/sys/spa.h:45,
                 from main.c:3:
/usr/include/libzfs/sys/abd.h:33:10: fatal error: sys/abd_os.h: No such file or directory
   33 | #include <sys/abd_os.h>
      |          ^~~~~~~~~~~~~~
compilation terminated.

@tonyhutter
Copy link
Contributor

@robn any thoughts on this one?

@behlendorf
Copy link
Contributor

This was fixed in the latest lustre code some time ago. Those changes just never made it back to lustre-2.15.6 since they weren't needed until we ended up pulling in all the kernel compatibility changes in zfs-2.2.7. Take a look at LLNL/lustre@46938c5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

No branches or pull requests

3 participants