Skip to content

feat: fix linux kernel 6.18 building problem#204

Open
gfdgd-xi wants to merge 1 commit intolinuxdeepin:masterfrom
gfdgd-xi:master
Open

feat: fix linux kernel 6.18 building problem#204
gfdgd-xi wants to merge 1 commit intolinuxdeepin:masterfrom
gfdgd-xi:master

Conversation

@gfdgd-xi
Copy link
Contributor

@gfdgd-xi gfdgd-xi commented Feb 8, 2026

因为 6.18 内核头文件已定义 init_mnt_ns 与 dkms 内的 init_mnt_ns 函数发生冲突导致编译不过,故修改 init_mnt_ns 函数名以规避该问题

linux/mnt_namespace.h:14:extern struct mnt_namespace init_mnt_ns;
linux/ns_common.h:22:extern struct mnt_namespace init_mnt_ns;

Summary by Sourcery

Bug Fixes:

  • Resolve a build failure on Linux kernel 6.18 by renaming the vfs_kretprobes init_mnt_ns helper and updating its associated log message.

Signed-off-by: gfdgd_xi <3025613752@qq.com>
@sourcery-ai
Copy link

sourcery-ai bot commented Feb 8, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Renames the module-local init_mnt_ns() helper to init_mnt_ns_data() and updates its log message and caller to avoid symbol name conflicts with the Linux 6.18 kernel headers while preserving existing behavior.

Class diagram for renamed init_mnt_ns helper function

classDiagram
    class VfsKretprobesModule {
        <<module>>
        - struct mnt_namespace* target_mnt_ns
        - int init_mnt_ns_data()
        + int init_vfs_kretprobes(void vfs_changed_func)
    }

    VfsKretprobesModule : init_vfs_kretprobes() calls init_mnt_ns_data()
Loading

File-Level Changes

Change Details Files
Rename the internal mount-namespace initialization helper to avoid collision with a new kernel symbol in Linux 6.18.
  • Rename static inline function init_mnt_ns() to init_mnt_ns_data()
  • Update error log message string to reflect the new helper name
  • Update init_vfs_kretprobes() to call init_mnt_ns_data() instead of the old name
src/kernelmod/vfs_kretprobes.c

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: gfdgd-xi

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@deepin-ci-robot
Copy link

Hi @gfdgd-xi. Thanks for your PR.

I'm waiting for a linuxdeepin member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • Consider choosing a more descriptive function name than init_mnt_ns_data (e.g., indicating it initializes target_mnt_ns or is a workaround for kernel 6.18) to make its role clearer and distinguish it from the kernel symbol by intent, not just by suffix.
  • It may help future maintainers to add a brief comment near the function definition explaining that the rename is specifically to avoid the init_mnt_ns symbol collision introduced in Linux kernel 6.18.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider choosing a more descriptive function name than `init_mnt_ns_data` (e.g., indicating it initializes `target_mnt_ns` or is a workaround for kernel 6.18) to make its role clearer and distinguish it from the kernel symbol by intent, not just by suffix.
- It may help future maintainers to add a brief comment near the function definition explaining that the rename is specifically to avoid the `init_mnt_ns` symbol collision introduced in Linux kernel 6.18.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants