Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Kernel 3.6.0-rc1 compile issue #154

schreiberstein opened this Issue Aug 16, 2012 · 12 comments


None yet
5 participants

I can't build SPL with Linux 3.6.0-rc1 on my Gentoo (and Arch) system :

/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-vnode.c: In function ‘vn_remove’:
/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-vnode.c:327:2: error: implicit declaration of function ‘path_lookup’
make[5]: *** [/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module/spl/../../module/spl/spl-vnode.o] Error 1
make[5]: *** Waiting for unfinished jobs....
make[3]: *** [_module_/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module] Error 2
make[3]: Leaving directory `/usr/src/linux-3.6-rc1'
make[2]: *** [modules] Error 2
make[2]: Leaving directory `/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999/module'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/var/tmp/portage/sys-kernel/spl-9999/work/spl-9999'
make: *** [all] Error 2

schreiberstein ~ # uname -a
Linux schreiberstein 3.6.0-rc1-schreiberstein #1 SMP Thu Aug 16 19:55:51 CEST 2012 x86_64 AMD Athlon(tm) 64 X2 Dual Core Processor 6000+ AuthenticAMD GNU/Linux

Full build log : http://pastebin.com/9J2tdXwk



ryao commented Aug 16, 2012

I wrote the following after eyeballing this:


It looks like Linux is removing access to to struct nameidata, so this will require more effort before it builds. As a note to future me, the relevant commit is torvalds/linux@79714f7.

@ryao: Still doesn't build, like I said in #zfsonlinux. : http://pastebin.com/67CU2CLY


ryao commented Aug 16, 2012

The following patch should resolve the issues that your paste showed:


I wrote it after eyeballing it. It has not been tested.


behlendorf commented Aug 17, 2012

sigh This is another good reason to remove the zpool.cache dependency from the Linux port. It would allow us to drop all of this vnode compatibility code which allows us to keep the /etc/zfs/zpool.cache file up to date from within the kernel. Still, it looks like we'll be able to handle the new interface.

Still the same problem with kernel 3.6-rc5 and Ubuntu


yshui commented Sep 20, 2012

@ryao I think you shouldn't remove the 'spl_inode_unlock(nd.nd_dentry->d_inode);' line?

3.6 kernel released, but SPL still can't be compiled with it


behlendorf commented Oct 4, 2012

Now that 3.6 has been officially releases we'll likely investigate the needed changes.


ryao commented Oct 8, 2012

@DarkRaven You are correct that I should be unlocking it there. That could be what was wrong, although we don't know until it is tested. I will test this locally on my computer and report the result.


ryao commented Oct 8, 2012

@DarkRaven That missing unlock turned out to be the issue. The following patch will provide Linux 3.6 support:


Note that it currently omits updated autotools checks, so it will break support for older kernels, although it should be easy to write that once myself or someone else finds time.


ryao commented Oct 11, 2012

@DarkRaven pointed out that I was missing path_put(). I have written a revised patch that corrects that:


We still need autotools checks and this code probably needs some more scrutiny. The original patch was something that I wrote when eyeballing the code quickly, and unfortunately, not everything was right on the first try.


ryao commented Oct 11, 2012

@DarkRaven has written autotools checks for the SPL patch and corrected lingering issues that were detected by splat:


This supersedes the SPL patch that I wrote.

@behlendorf behlendorf added a commit to behlendorf/spl that referenced this issue Oct 13, 2012

@nialv7 @behlendorf nialv7 + behlendorf Linux 3.6 compat, kern_path_locked() added
The kern_path_parent() function was removed from Linux 3.6 because
it was observed that all the callers just want the parent dentry.
The simpler kern_path_locked() function replaces kern_path_parent()
and does the lookup while holding the ->i_mutex lock.

This is good news for the vn implementation because it removes the
need for us to handle the locking.  However, it makes it harder to
implement a single readable vn_remove()/vn_rename() function which
is usually what we prefer.

Therefore, we implement a new version of vn_remove()/vn_rename()
for Linux 3.6 and newer kernels.  This allows us to leave the
existing working implementation untouched, and to add a simpler
version for newer kernels.

Long term I would very much like to see all of the vn code removed
since what this code enabled is generally frowned upon in the kernel.
But that can't happen util we either abondon the zpool.cache file
or implement alternate infrastructure to update is correctly in
user space.

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Signed-off-by: Richard Yao <ryao@cs.stonybrook.edu>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Issue #154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment