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

Add kernel 3.11 support (to Daily PPA builds) #1591

Closed
jonathonf opened this issue Jul 15, 2013 · 8 comments
Closed

Add kernel 3.11 support (to Daily PPA builds) #1591

jonathonf opened this issue Jul 15, 2013 · 8 comments
Labels
Type: Building Indicates an issue related to building binaries
Milestone

Comments

@jonathonf
Copy link
Contributor

As a heads-up, there are more changes coming in kernel 3.11. The current kernel modules fail to build against 3.11-rc1.

Full log: https://gist.github.com/jonathonf/6001198

Most pertinent parts:

make[3]: Entering directory `/usr/src/linux-headers-3.11.0-031100rc1-generic'
  CC [M]  /var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.o
In file included from /var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c:39:0:
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c: In function ‘trace_max_debug_mb’:
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c:551:27: error: ‘num_physpages’ undeclared (first use in this function)
         return MAX(512, ((num_physpages >> (20 - PAGE_SHIFT)) * 80) / 100);
                           ^
/var/lib/dkms/spl/0.6.1/build/include/sys/sysmacros.h:161:28: note: in definition of macro ‘MAX’
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
                            ^
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c:551:27: note: each undeclared identifier is reported only once for each function it appears in
         return MAX(512, ((num_physpages >> (20 - PAGE_SHIFT)) * 80) / 100);
                           ^
/var/lib/dkms/spl/0.6.1/build/include/sys/sysmacros.h:161:28: note: in definition of macro ‘MAX’
 #define MAX(a, b)  ((a) < (b) ? (b) : (a))
                            ^
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c: In function ‘spl_debug_init’:
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c:1191:20: error: ‘num_physpages’ undeclared (first use in this function)
         if (max > (num_physpages >> (20 - 2 - PAGE_SHIFT)) / 5 ||
                    ^
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c: In function ‘trace_max_debug_mb’:
/var/lib/dkms/spl/0.6.1/build/module/spl/../../module/spl/spl-debug.c:552:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^

Installed version:

spl:
  Installed: 0.6.1-2~saucy~2.gbpd297e0
  Candidate: 0.6.1-2~saucy~2.gbpd297e0
  Version table:
 *** 0.6.1-2~saucy~2.gbpd297e0 0
       1001 http://ppa.launchpad.net/zfs-native/daily/ubuntu/ saucy/main amd64 Packages
        100 /var/lib/dpkg/status
     0.6.1-1~raring 0
       1001 http://ppa.launchpad.net/zfs-native/stable/ubuntu/ raring/main amd64 Packages
@ryao
Copy link
Contributor

ryao commented Jul 15, 2013

We could probably address this by switching to either totalram_pages or totalhigh_pages.

@behlendorf
Copy link
Contributor

Or just removing the ensure debug subsystem from the spl. This code is no longer used (even by me) now that there are better tools available like ftrace, systemtap, oprofile, and perf.

@ryao
Copy link
Contributor

ryao commented Aug 7, 2013

That is not possible because physmem is an alias for num_physpages. I have opened openzfs/spl#273 with a patch that addresses this failure. With that patch in place, the following failure will occur in ZFS:

/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:178:2: error: unknown field ‘readdir’ specified in initializer
  .readdir = zpl_root_readdir,
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:178:2: error: initialization from incompatible pointer type [-Werror]
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:178:2: error: (near initialization for ‘zpl_fops_root.write’) [-Werror]
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:416:2: error: unknown field ‘readdir’ specified in initializer
  .readdir = zpl_snapdir_readdir,
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:416:2: error: initialization from incompatible pointer type [-Werror]
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:416:2: error: (near initialization for ‘zpl_fops_snapdir.write’) [-Werror]
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:535:2: error: unknown field ‘readdir’ specified in initializer
  .readdir = zpl_shares_readdir,
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:535:2: error: initialization from incompatible pointer type [-Werror]
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.c:535:2: error: (near initialization for ‘zpl_fops_shares.write’) [-Werror]
cc1: all warnings being treated as errors
make[6]: *** [/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_ctldir.o] Error 1
  CC [M]  /var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_super.o
  CC [M]  /var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_xattr.o
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_file.c:506:2: error: unknown field ‘readdir’ specified in initializer
  .readdir = zpl_readdir,
  ^
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_file.c:506:2: error: initialization from incompatible pointer type [-Werror]
/var/tmp/portage/sys-fs/zfs-kmod-9999/work/zfs-kmod-9999/module/zfs/../../module/zfs/zpl_file.c:506:2: error: (near initialization for ‘zpl_dir_file_operations.write’) [-Werror]
cc1: all warnings being treated as errors

This failure was caused by torvalds/linux@2233f31.

@ryao
Copy link
Contributor

ryao commented Aug 9, 2013

I have opened #1639 with a patch that resolves the above issue. I am currently using ZFS with Linux 3.11-rc4.

behlendorf pushed a commit that referenced this issue Aug 16, 2013
Commit torvalds/linux@2233f31
replaced ->readdir() with ->iterate() in struct file_operations.
All filesystems must now use the new ->iterate method.

To handle this the code was reworked to use the new ->iterate
interface.  Care was taken to keep the majority of changes
confined to the ZPL layer which is already Linux specific.
However, minor changes were required to the common zfs_readdir()
function.

Compatibility with older kernels was accomplished by adding
versions of the trivial dir_emit* helper functions.  Also the
various *_readdir() functions were reworked in to wrappers
which create a dir_context structure to pass to the new
*_iterate() functions.

Unfortunately, the new dir_emit* functions prevent us from
passing a private pointer to the filldir function.  The xattr
directory code leveraged this ability through zfs_readdir()
to generate the list of xattr names.  Since we can no longer
use zfs_readdir() a simplified zpl_xattr_readdir() function
was added to perform the same task.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1653
Issue #1591
@behlendorf
Copy link
Contributor

Support has been added for 3.11 and tested with 3.11-rc5.

@ryao
Copy link
Contributor

ryao commented Aug 16, 2013

There is still a build failure when CONFIG_LZ4_DECOMPRESS=y or CONFIG_LZ4_COMPRESS=y is set. We need to rename the lz4_compress/lz4_decompress functions to workaround it.

@behlendorf
Copy link
Contributor

@ryao I've filed #1659 for the symbol conflict. However, that shouldn't impact this issue since the stock Ubuntu kernels don't build with CONFIG_LZ4_DECOMPRESS=y or CONFIG_LZ4_COMPRESS=y.

@jonathonf
Copy link
Contributor Author

Just to confirm, packages in Daily PPA work for me with 3.11. Thank you all!

linux-image:
  Installed: 3.11.0.2.3

spl:
  Installed: 0.6.1-2~saucy~4.gbpf9ef63

unya pushed a commit to unya/zfs that referenced this issue Dec 13, 2013
Commit torvalds/linux@2233f31
replaced ->readdir() with ->iterate() in struct file_operations.
All filesystems must now use the new ->iterate method.

To handle this the code was reworked to use the new ->iterate
interface.  Care was taken to keep the majority of changes
confined to the ZPL layer which is already Linux specific.
However, minor changes were required to the common zfs_readdir()
function.

Compatibility with older kernels was accomplished by adding
versions of the trivial dir_emit* helper functions.  Also the
various *_readdir() functions were reworked in to wrappers
which create a dir_context structure to pass to the new
*_iterate() functions.

Unfortunately, the new dir_emit* functions prevent us from
passing a private pointer to the filldir function.  The xattr
directory code leveraged this ability through zfs_readdir()
to generate the list of xattr names.  Since we can no longer
use zfs_readdir() a simplified zpl_xattr_readdir() function
was added to perform the same task.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#1653
Issue openzfs#1591
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
None yet
Development

No branches or pull requests

3 participants