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

ZFS with --enable-debug fails to compile on Linux 3.3.0 #613

Closed
ryao opened this issue Mar 20, 2012 · 2 comments
Closed

ZFS with --enable-debug fails to compile on Linux 3.3.0 #613

ryao opened this issue Mar 20, 2012 · 2 comments
Milestone

Comments

@ryao
Copy link
Contributor

ryao commented Mar 20, 2012

Linux 3.3.0 appears to have changed some of the function prototypes in inode_operations. In specific, they changed zpl_create, mkdir and mknod. The third argument is now umode_t instead of int.

This causes a build with --enable-debug to fail with the following message. --disable-debug is unaffected.

cc1: warnings being treated as errors
/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.c:355:2: error: initialization from incompatible pointer type
/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.c:359:2: error: initialization from incompatible pointer type
/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.c:361:2: error: initialization from incompatible pointer type
/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.c:376:2: error: initialization from incompatible pointer type
/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.c:381:2: error: initialization from incompatible pointer type
/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.c:383:2: error: initialization from incompatible pointer type
make[6]: *** [/var/tmp/portage/sys-fs/zfs-9999/work/zfs-9999/module/zfs/../../module/zfs/zpl_inode.o] Error 1

@ryao
Copy link
Contributor Author

ryao commented Mar 21, 2012

Note that I am able to workaround this by changing the function prototypes of functions in zpl_inode.c to use umode_t instead of int in the case of create, mkdir and mknod and to use umode_t instead of mode_t in the case of a helper function. It breaks older kernels, but proper preprocessor directives should fix that.

@ryao ryao mentioned this issue Apr 6, 2012
ryao added a commit to ryao/zfs that referenced this issue Apr 27, 2012
Linux 3.3.0 changed some of the function prototypes in inode_operations.
In specific, they changed create, mkdir and mknod.  The third argument
is now umode_t instead of int.

This caused a build with --enable-debug to fail. --disable-debug is
unaffected. We fix this by introducing preprocessor directives to alter
the function prototypes on Linux 3.3.0 and greater.

This closes ZFSOnLinux issue openzfs#613.

Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
@behlendorf
Copy link
Contributor

Fix merged as commit b39d3b9

pcd1193182 pushed a commit to pcd1193182/zfs that referenced this issue Sep 26, 2023
The sysinfo crate changed the meaning of `System::total_memory()`, from
returning kilobytes to returning bytes.  This makes the agent think that
the system has 1024x the amount of RAM that it really does, and we try
to use more memory than exists.

The problem was introduced by PR openzfs#608

This commit changes our code to interpret the new meaning of the return
value correctly.
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

2 participants