技术解析
我司入了台洋辣鸡做 NAS ,装上 Ubuntu 16.04 跑 ZFS 。
今天正好想起来,登上服务器把玩一番,一不小心就发现了奇怪的情况。
Ubuntu 趁人不备,在后台给我静默安装了 15 个不同版本的内核。
默默 dpkg 列出了所有的内核和脑袋,去掉当前的和最新的,剩下的统统拿去 purge 了。
Purge 花了不少时间,毕竟要处理各种 dkms 和 grub 呢。
全跑完一看……
ZFS 内核模块编译不通过……
仔细读了 Log 发现, 4.4.0-21 是能编译过的, 4.4.0-62 是一定会炸的。
回去跑了 dkms install zfs -v 0.6.5.6 -k 4.4.0-62-generic
看了眼,发现编译错误指向了一个系统 API :
/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c: In function ‘__zpl_xattr_acl_set_access ’:
/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:1284:28: warning: passing argument 1 of ‘ posix_acl_valid ’ from incompatible pointer type [-Wincompatible-pointer-types]
error = posix_acl_valid(acl);
^
In file included from /var/lib/dkms/zfs/0.6.5.6/build/include/linux/vfs_compat.h:204:0,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zpl.h:37,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zfs_vnops.h:34,
from /var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:81:
include/linux/posix_acl.h:84:12: note: expected ‘ struct user_namespace *’ but argument is of type ‘ struct posix_acl *’
extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *);
^
/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:1284:12: error: too few arguments to function ‘ posix_acl_valid ’
error = posix_acl_valid(acl);
^
In file included from /var/lib/dkms/zfs/0.6.5.6/build/include/linux/vfs_compat.h:204:0,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zpl.h:37,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zfs_vnops.h:34,
from /var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:81:
include/linux/posix_acl.h:84:12: note: declared here
extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *);
^
/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c: In function ‘__zpl_xattr_acl_set_default ’:
/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:1323:28: warning: passing argument 1 of ‘ posix_acl_valid ’ from incompatible pointer type [-Wincompatible-pointer-types]
error = posix_acl_valid(acl);
^
In file included from /var/lib/dkms/zfs/0.6.5.6/build/include/linux/vfs_compat.h:204:0,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zpl.h:37,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zfs_vnops.h:34,
from /var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:81:
include/linux/posix_acl.h:84:12: note: expected ‘ struct user_namespace *’ but argument is of type ‘ struct posix_acl *’
extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *);
^
/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:1323:12: error: too few arguments to function ‘ posix_acl_valid ’
error = posix_acl_valid(acl);
^
In file included from /var/lib/dkms/zfs/0.6.5.6/build/include/linux/vfs_compat.h:204:0,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zpl.h:37,
from /var/lib/dkms/zfs/0.6.5.6/build/include/sys/zfs_vnops.h:34,
from /var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.c:81:
include/linux/posix_acl.h:84:12: note: declared here
extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *);
^
scripts/Makefile.build:258: recipe for target '/var/lib/dkms/zfs/0.6.5.6/build/module/zfs/zpl_xattr.o' failed
默默翻出之前卸掉的那些脑袋包看了眼……
# grep posix_acl_valid /usr/src/linux-headers-4.4.0-??/include/linux/posix_acl.h
/usr/src/linux-headers-4.4.0-21/include/linux/posix_acl.h:extern int posix_acl_valid(const struct posix_acl *);
/usr/src/linux-headers-4.4.0-47/include/linux/posix_acl.h:extern int posix_acl_valid(const struct posix_acl *);
/usr/src/linux-headers-4.4.0-57/include/linux/posix_acl.h:extern int posix_acl_valid(const struct posix_acl *);
/usr/src/linux-headers-4.4.0-59/include/linux/posix_acl.h:extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *);
/usr/src/linux-headers-4.4.0-62/include/linux/posix_acl.h:extern int posix_acl_valid(struct user_namespace *, const struct posix_acl *);
没什么好说的,滚回之前的版本就好了……
头一次信 Ubuntu ,就给我看这个……