zfsonlinux / pkg-zfs

Native ZFS packaging for Debian and Ubuntu
https://launchpad.net/~zfs-native/+archive/daily
308 stars 55 forks source link

Ubuntu Vivid: Failed to install ubuntu-zfs, struct member f_dentry issue #144

Closed nosuz closed 9 years ago

nosuz commented 9 years ago

I tried to install ubuntu-zfs package on Ubuntu 15.04 server. But that was failed on making kernel modules.

Thinkg from log messages, the issue is the same as error: 'struct file' has no member named 'f_dentry' #2959.

What I did

Installed the system from Daily Build Vivid-server-amd64.iso image. The output from uname -a is

Linux zfs 3.19.0-7-generic #7-Ubuntu SMP Thu Feb 26 20:19:34 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

You will find the word 'zfs' in the output but it might be because I got this after tried installation.

And

$ sudo add-apt-repository -y ppa:zfs-native/stable $ sudo apt-get update $ sudo apt-get -y install ubuntu-zfs

What I got

I found two error messages in the last command outputs.

The two packages, spl-dkms and zfs-dkms are automatically installed on ubuntu-zfs dependencies.

Building initial module for 3.19.0-7-generic
Error! Bad return status for module build on kernel: 3.19.0-7-generic (x86_64)
Consult /var/lib/dkms/spl/0.6.3/build/make.log for more information.

/var/lib/dkms/spl/0.6.3/build/make.log

make[2]: Entering directory '/var/lib/dkms/spl/0.6.3/build/module'
make -C /lib/modules/3.19.0-7-generic/build SUBDIRS=`pwd`  CONFIG_SPL=m modules
make[3]: Entering directory '/usr/src/linux-headers-3.19.0-7-generic'

<snip>

CC [M]  /var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.o
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c: In function 'splat_unlocked_ioctl':
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c:460:41: error: 'struct file' has no member named 'f_dentry'
         unsigned int minor = iminor(file->f_dentry->d_inode);
                                         ^
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c: In function 'splat_write':
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c:502:41: error: 'struct file' has no member named 'f_dentry'
         unsigned int minor = iminor(file->f_dentry->d_inode);
                                         ^
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c: In function 'splat_read':
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c:539:41: error: 'struct file' has no member named 'f_dentry'
         unsigned int minor = iminor(file->f_dentry->d_inode);
                                         ^
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c: In function 'splat_seek':
/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.c:573:41: error: 'struct file' has no member named 'f_dentry'
         unsigned int minor = iminor(file->f_dentry->d_inode);
                                         ^
scripts/Makefile.build:257: recipe for target '/var/lib/dkms/spl/0.6.3/build/module/splat/../../module/splat/splat-ctl.o' failed
Building initial module for 3.19.0-7-generic
configure: error: 
    *** Please make sure the kmod spl devel <kernel> package for your
    *** distribution is installed then try again.  If that fails you
    *** can specify the location of the spl objects with the
    *** '--with-spl-obj=PATH' option.
Error! Bad return status for module build on kernel: 3.19.0-7-generic (x86_64)
Consult /var/lib/dkms/zfs/0.6.3/build/make.log for more information.

/var/lib/dkms/zfs/0.6.3/build/make.log

DKMS make.log for zfs-0.6.3 for kernel 3.19.0-7-generic (x86_64)
Fri Mar  6 12:25:16 JST 2015
make: *** No targets specified and no makefile found.  Stop.

struct member issue

I think the issue on installing spl-dkms is the same as error: 'struct file' has no member named 'f_dentry' #2959 and the error on zfs-dkms is depend on it.

I made patch for the splat-ctl.c and found the splat.ko can be made. This patch is just to fix the compile error but might not work as a part of ZFS.

splat-ctl.c.diff

--- splat-ctl.c.orig    2015-03-06 12:34:55.933618366 +0900
+++ splat-ctl.c 2015-03-06 12:37:30.267278643 +0900
@@ -457,7 +457,7 @@
 static long
 splat_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 {
-        unsigned int minor = iminor(file->f_dentry->d_inode);
+        unsigned int minor = iminor(file->f_path.dentry);
    int rc = 0;

    /* Ignore tty ioctls */
@@ -499,7 +499,7 @@
 static ssize_t splat_write(struct file *file, const char __user *buf,
                          size_t count, loff_t *ppos)
 {
-        unsigned int minor = iminor(file->f_dentry->d_inode);
+        unsigned int minor = iminor(file->f_path.dentry);
    splat_info_t *info = (splat_info_t *)file->private_data;
    int rc = 0;

@@ -536,7 +536,7 @@
 static ssize_t splat_read(struct file *file, char __user *buf,
                size_t count, loff_t *ppos)
 {
-        unsigned int minor = iminor(file->f_dentry->d_inode);
+        unsigned int minor = iminor(file->f_path.dentry);
    splat_info_t *info = (splat_info_t *)file->private_data;
    int rc = 0;

@@ -570,7 +570,7 @@

 static loff_t splat_seek(struct file *file, loff_t offset, int origin)
 {
-        unsigned int minor = iminor(file->f_dentry->d_inode);
+        unsigned int minor = iminor(file->f_path.dentry);
    splat_info_t *info = (splat_info_t *)file->private_data;
    int rc = -EINVAL;

I hope this report makes some help to fix the package problem. Thank you.

nosuz commented 9 years ago

I could install ubuntu-zfs package on Ubuntu 15.04(Vivid) from ppa:zfs-native/daily with success.

Thus this issue will be useless until the release of Ubuntu 15.04.

Thank you.