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

Debian Stretch: zfs dkms module build fails with NR_FILE_PAGES in either node_stat_item or zone_stat_item: NOT FOUND #7358

Closed
creshal opened this issue Mar 28, 2018 · 15 comments
Labels
Type: Building Indicates an issue related to building binaries
Projects

Comments

@creshal
Copy link

creshal commented Mar 28, 2018

System information

Type Version/Name
Distribution Name Debian
Distribution Version 9.4
Linux Kernel 4.9.0-6-amd64 #1 SMP Debian 4.9.82-1+deb9u3
Architecture amd64
ZFS Version 0.7.7
SPL Version 0.7.7

Describe the problem you're observing

dkms build zfs/0.7.7 fails with:

checking whether asm/fpu/api.h exists... yes                                               
checking whether i_(uid|gid)_(read|write) exist... yes                               
checking whether module_param_call() is hardened... no                          
checking whether iops->rename() wants flags... yes
checking whether generic_setxattr() exists... no  
checking whether current_time() exists... yes     
checking whether global_node_page_state() exists... yes                                            
checking whether global_zone_page_state() exists... no                                                   
checking whether enum node_stat_item contains NR_FILE_PAGES... no                          
checking whether enum node_stat_item contains NR_INACTIVE_ANON... no                 
checking whether enum node_stat_item contains NR_INACTIVE_FILE... no            
checking whether enum node_stat_item contains NR_SLAB_RECLAIMABLE... no
checking whether enum zone_stat_item contains NR_FILE_PAGES... no
checking whether enum zone_stat_item contains NR_INACTIVE_ANON... no                   
checking whether enum zone_stat_item contains NR_INACTIVE_FILE... no                  
checking whether enum zone_stat_item contains NR_SLAB_RECLAIMABLE... no                   
checking global_page_state enums are sane... no                                     
NR_FILE_PAGES in either node_stat_item or zone_stat_item: NOT FOUND
configure needs updating, see: config/kernel-global_page_state.m4
configure: error: in `/var/lib/dkms/zfs/0.7.7/build':
configure: error: SHUT 'ER DOWN CLANCY, SHE'S PUMPIN' MUD!

(Full log)

Describe how to reproduce the problem

  1. Build spl and zfs each with default settings (autogen.sh && configure), build utils and dkms packages (make deb-utils deb-dkms)
  2. Install the generated spl and spl-dkms packages, notice dkms build works.
  3. Install the generated packages for libraries (uutil, nvpair, zfs2, zfs2-devel, zpool2), zfs and zfs-dkms.
  4. Notice dkms build fails without any error message, manually re-run dkms build zfs/0.7.7 to get to aforementioned error message.

make deb-kmod doesn't trigger any error fwiw and seems to build fine, but modprobe fails with

[  220.500838] zcommon: disagrees about version of symbol __kstat_delete
[  220.500841] zcommon: Unknown symbol __kstat_delete (err -22)
[  220.500864] zcommon: disagrees about version of symbol __kstat_create
[  220.500866] zcommon: Unknown symbol __kstat_create (err -22)
[  220.500885] zcommon: disagrees about version of symbol __kstat_set_raw_ops
[  220.500886] zcommon: Unknown symbol __kstat_set_raw_ops (err -22)
[  220.500915] zcommon: disagrees about version of symbol __kstat_install
[  220.500917] zcommon: Unknown symbol __kstat_install (err -22)

Is this related, or a different issue?

@creshal
Copy link
Author

creshal commented Mar 28, 2018

FWIW, I'm trying to upgrade from 0.7.3, where zfs-dkms built the same way worked fine.

@dioni21
Copy link
Contributor

dioni21 commented Apr 4, 2018

This is also criplling instalation on RHEL latest kernel-3.10.0-693.21.1.el7.x86_64

It works perfectly at kernel-3.10.0-693.5.2.el7.x86_64

@dioni21
Copy link
Contributor

dioni21 commented Apr 5, 2018

This is also criplling instalation on RHEL latest kernel-3.10.0-693.21.1.el7.x86_64

It works perfectly at kernel-3.10.0-693.5.2.el7.x86_64

Indeed, I could make it work! Still not sure about what the problem is, but what does not work is upgrading!

I removed every instance of old kernel and kernel-devel from the new machine. Also, removed every .ko file from /lib/modules/3.10.0-693.21.1.el7.x86_64/weak-updates/

After this, yum reinstall spl-dkms && yum reinstall zfs-dkms, (or something like that, it was not straightforward) and now everything works...

@turrini
Copy link

turrini commented Apr 6, 2018

The same problem happens too with Debian Buster (Linux 4.15.0-2 [4.15.11])

@akorn
Copy link
Contributor

akorn commented Apr 7, 2018

The problem seems to be that the enum-extract.pl script is not shipped:

/var/lib/dkms/zfs/0.7.7/build/configure: line 26817: ./scripts/enum-extract.pl: No such file or directory

@turrini
Copy link

turrini commented Apr 7, 2018

Found it.

Debian splits Linux header files in two folders:

/usr/include/linux-headers-$kern_ver-common
and
/usr/include/linux-headers-$kern_ver-amd64

zfs-dkms seems configured to look for "include/linux/mmzone.h" inside the "-amd64" folder. One way to mitigate this is to symlink "include/linux" folder from "-common":

/usr/include/linux-headers-$kern_ver-amd64/include/ln -s /usr/include/linux-headers-$kern_ver-common/include/linux .

Now it compiles successfully.

@creshal
Copy link
Author

creshal commented Apr 9, 2018

For Debian Stretch the files are in /usr/src/, not /usr/include/, but I can confirm the workaround works (compiles and module loads and everything works). Now how can it be fixed permanently?

@turrini
Copy link

turrini commented Apr 9, 2018

@creshal Sorry and thanks for fixing it :-)

@behlendorf behlendorf added the Type: Building Indicates an issue related to building binaries label Apr 11, 2018
@jaredj
Copy link

jaredj commented Apr 24, 2018

I experienced the issue @akorn encountered and found that at least for me it was an issue with the debian packaging: the override_dh_auto_install target in debian/rules goes to some trouble to install a minimal set of files in /usr/src/zfs-${version}, excluding all plain files within scripts/ from installation. FTR I was using a modifed version of a PPA trusty backport of 0.7.1 so YMMV but it looks like at least the official ubuntu and debian packages to similar things. I worked around the issue by modifying debian/rules to install all files in scripts/ although I'm sure it would be possible to special-case only that specific file.

It sounds like the issue @akorn and I encountered was separate from the one worked around by @turrini

@akorn
Copy link
Contributor

akorn commented Apr 24, 2018

I agree, it was a separate issue. I also build my own packages based on the pkg-zfs repository.

@jaredj
Copy link

jaredj commented Apr 24, 2018

@akorn in case it's useful my modification to debian/rules can be seen here

aerusso added a commit to aerusso/zfs that referenced this issue May 21, 2018
scripts/dkms.mkconf calls configure with

`--with-linux=${kernel_source_dir}`, but Debian puts it kernel source at
`/lib/modules/<version>/source`. This patch adds the same logic to the
DKMS file produced by `scripts/dkms.mkconf` that Debian has shipped in
its official ZFS packaging: at DKMS build time, it checks if the system
is a Debian system, and adjusts the path accordingly.

Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes openzfs#7358 openzfs#7540
@aerusso aerusso mentioned this issue May 21, 2018
12 tasks
@aerusso
Copy link
Contributor

aerusso commented May 23, 2018

@creshal Could you confirm that PR #7554 fixes this problem for you?

@creshal
Copy link
Author

creshal commented May 23, 2018

I no longer get any useful error messages, but it still doesn't build.

dkms output shows no error messages apart from "failed":

[…]
config.status: executing libtool commands

Building module:
cleaning build area...
make -j8 KERNELRELEASE=4.9.0-6-amd64...........
Error!  Build of zlua.ko failed for: 4.9.0-6-amd64 (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/zfs/0.7.8/build/ for more information.

make.log isn't helpful either.

@behlendorf
Copy link
Contributor

Error! Build of zlua.ko failed for: 4.9.0-6-amd64 (x86_64)

The zlua.ko module doesn't exist in the 0.7.8 release. I'd suggest trying a clean install after making sure everything spl and zfs related has been removed from under /var/lib/dkms/.

aerusso added a commit to aerusso/zfs that referenced this issue May 24, 2018
scripts/dkms.mkconf calls configure with

`--with-linux=${kernel_source_dir}`, but Debian puts it kernel source at
`/lib/modules/<version>/source`. This patch adds the same logic to the
DKMS file produced by `scripts/dkms.mkconf` that Debian has shipped in
its official ZFS packaging: at DKMS build time, it checks if the system
is a Debian system, and adjusts the path accordingly.

Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes openzfs#7358 openzfs#7540
@creshal
Copy link
Author

creshal commented Jun 11, 2018

Okay, patched dkms.mkconf the wrong way, properly patched it works.

tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Aug 15, 2018
scripts/dkms.mkconf calls configure with
`--with-linux=${kernel_source_dir}`, but Debian puts it kernel source at
`/lib/modules/<version>/source`. This patch adds the same logic to the
DKMS file produced by `scripts/dkms.mkconf` that Debian has shipped in
its official ZFS packaging: at DKMS build time, it checks if the system
is a Debian system, and adjusts the path accordingly.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes openzfs#7358 
Closes openzfs#7540 
Closes openzfs#7554
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Aug 23, 2018
scripts/dkms.mkconf calls configure with
`--with-linux=${kernel_source_dir}`, but Debian puts it kernel source at
`/lib/modules/<version>/source`. This patch adds the same logic to the
DKMS file produced by `scripts/dkms.mkconf` that Debian has shipped in
its official ZFS packaging: at DKMS build time, it checks if the system
is a Debian system, and adjusts the path accordingly.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes openzfs#7358 
Closes openzfs#7540 
Closes openzfs#7554
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Sep 5, 2018
scripts/dkms.mkconf calls configure with
`--with-linux=${kernel_source_dir}`, but Debian puts it kernel source at
`/lib/modules/<version>/source`. This patch adds the same logic to the
DKMS file produced by `scripts/dkms.mkconf` that Debian has shipped in
its official ZFS packaging: at DKMS build time, it checks if the system
is a Debian system, and adjusts the path accordingly.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: George Melikov <mail@gmelikov.ru>
Signed-off-by: Antonio Russo <antonio.e.russo@gmail.com>
Closes openzfs#7358 
Closes openzfs#7540 
Closes openzfs#7554
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Building Indicates an issue related to building binaries
Projects
No open projects
0.7.9
  
Awaiting triage
Development

No branches or pull requests

7 participants