[分享] 被 Ubuntu 坑了

2017-02-20 14:06:07 +08:00
 msg7086

前情摘要

我司入了台洋辣鸡做 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 ,就给我看这个……

9609 次点击
所在节点    Linux
41 条回复
msg7086
2017-02-22 01:45:12 +08:00
@madper 为毛我要编译?我没编译啊, apt 帮我编译的,我也不知道怎么回事……就看到 apt 日志里一排排的错误信息。

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/341747

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX