Skip to content

编译失败:5.10 内核 implicit declaration of 'susfs_sus_kstat_spoof_vfs_statfs' (fs/statfs.c:88) #269

Description

@yumobei

问题描述

机型:一加 Ace 竞速版(OnePlus Ace Race),Android 15,内核 5.10.236。
配置:oneplus_ace_race_v + ReSukiSU 分支,SUSFS_META 留空(拉取最新上游 SUSFS)。

编译报错:

../fs/statfs.c:88:7: error: implicit declaration of function 'susfs_sus_kstat_spoof_vfs_statfs' [-Werror,-Wimplicit-function-declaration]
        if (!susfs_sus_kstat_spoof_vfs_statfs(d_backing_inode(dentry), buf, is_fuse))
             ^
1 error generated.
make[2]: *** [../scripts/Makefile.build:281: fs/statfs.o] Error 1
make[1]: *** [kernel_workspace/kernel-5.10/Makefile:1938: fs] Error 2

原因分析

根源在 SUSFS 上游 susfs4ksu 的 gki-android12-5.10 分支(simonpunk 最近在重构 SUS_KSTAT 的 statfs 隐藏逻辑:9/10 重构提交 789702ef 引入,9/12-9/13 连续 4 个修复提交)。补丁 50_add_susfs_in_gki-android12-5.10.patch 中:

  • susfs_statfs_by_dentry() 里调用 susfs_sus_kstat_spoof_vfs_statfs()(插在 vfs_get_fsid() 之前,约第 88 行)
  • extern int susfs_sus_kstat_spoof_vfs_statfs(...) 声明却插在 vfs_get_fsid() 之后(约第 112 行)

调用点在前、声明在后,C 语言要求先声明后使用,因此报 implicit declaration(-Werror 直接失败)。

临时解决办法(已验证可行)

「回退SUSFS」(SUSFS_META)填 5(= HEAD~5,即 9/6 的 7373f8d8,重构前无此 statfs 钩子,可正常编译),或直接填 commit hash 7373f8d8

建议

上游修复前,建议将默认 SUSFS 固定到稳定版本,或在 README 中提示 5.10 用户回退 SUSFS,避免拉取到正在重构中的最新分支。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Source ErrorThere is a problem with the Upstream SourceUpstream ErrorThere is a problem with the Manager error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions