From: bot+bpf-ci@kernel.org
To: chenyuan_fl@163.com,bpf@vger.kernel.org
Cc: linux-kernel@vger.kernel.org,alexei.starovoitov@gmail.com,ast@kernel.org,daniel@iogearbox.net,andrii@kernel.org,eddyz87@gmail.com,memxor@gmail.com,martin.lau@linux.dev,song@kernel.org,yonghong.song@linux.dev,jolsa@kernel.org,ihor.solodrai@linux.dev,chenyuan@kylinos.cn,ast@kernel.org,andrii@kernel.org,daniel@iogearbox.net,martin.lau@kernel.org,eddyz87@gmail.com,yonghong.song@linux.dev,mason@kernel.org,ihor.solodrai@linux.dev
Subject: Re: [PATCH bpf-next 1/2] bpf: Keep target extended until its last freplace link detaches
Date: Wed, 23 Sep 2026 10:02:32 +0000 (UTC) [thread overview]
Message-ID: <aa9703467e35f52305c33ee831cfcf56d9b9237ada65eb942e19d44b78451020@mail.kernel.org> (raw)
In-Reply-To: <20260923090635.368488-2-chenyuan_fl@163.com>
[-- Attachment #1: Type: text/plain, Size: 2407 bytes --]
> diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> index e7c5e203eddd..d5a20974a8aa 100644
> --- a/include/linux/bpf.h
> +++ b/include/linux/bpf.h
[ ... ]
> diff --git a/kernel/bpf/arraymap.c b/kernel/bpf/arraymap.c
> index 0ce26b538075..0fe9afd4a591 100644
> --- a/kernel/bpf/arraymap.c
> +++ b/kernel/bpf/arraymap.c
[ ... ]
> diff --git a/kernel/bpf/trampoline.c b/kernel/bpf/trampoline.c
> index 90b70ea0d370..f6e6533deb0b 100644
> --- a/kernel/bpf/trampoline.c
> +++ b/kernel/bpf/trampoline.c
> @@ -843,7 +843,7 @@ static enum bpf_tramp_prog_type bpf_attach_type_to_tramp(struct bpf_prog *prog)
> }
> }
>
> -static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog)
> +static int bpf_freplace_link_tgt_prog(struct bpf_prog *tgt_prog)
> {
> struct bpf_prog_aux *aux = tgt_prog->aux;
>
> @@ -857,7 +857,7 @@ static int bpf_freplace_check_tgt_prog(struct bpf_prog *tgt_prog)
> */
> return -EBUSY;
>
> - aux->is_extended = true;
> + aux->freplace_link_cnt++;
> return 0;
> }
This isn't a bug, but would it be worth keeping this fix minimal for
backporting and doing the rename as a separate follow-up patch?
The rename from bpf_freplace_check_tgt_prog() to
bpf_freplace_link_tgt_prog() is independent of the counting fix: the
only functional change in this helper is 'aux->is_extended = true'
becoming 'aux->freplace_link_cnt++', which does not require a new name.
Since the patch carries a Fixes: tag for d6083f040d5d, it is a
stable-backport candidate, and folding a rename into it adds conflict
surface for no behavioural reason.
If the rename stays, does something like bpf_freplace_get_tgt_prog() or
bpf_freplace_reserve_tgt_prog() read less ambiguously next to
__bpf_trampoline_link_prog(), where 'link' means 'attach a program to a
trampoline'?
>
> @@ -970,7 +970,7 @@ static int __bpf_trampoline_link_prog(struct bpf_tramp_node *node,
> /* Cannot attach extension if fentry/fexit are in use. */
> if (cnt)
> return -EBUSY;
> - err = bpf_freplace_check_tgt_prog(tgt_prog);
> + err = bpf_freplace_link_tgt_prog(tgt_prog);
> if (err)
> return err;
> tr->extension_prog = node->link->prog;
[ ... ]
---
AI reviewed your patch. Please fix the bug or email reply why it's not a bug.
See: https://github.com/kernel-patches/vmtest/blob/master/ci/claude/README.md
CI run summary: https://github.com/kernel-patches/bpf/actions/runs/35842777159
next prev parent reply other threads:[~2026-09-23 10:02 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-23 9:06 [PATCH bpf-next 0/2] " chenyuan_fl
2026-09-23 9:06 ` [PATCH bpf-next 1/2] " chenyuan_fl
2026-09-23 9:54 ` Leon Hwang
2026-09-23 10:02 ` bot+bpf-ci [this message]
2026-09-23 22:14 ` Alexei Starovoitov
2026-09-23 9:06 ` [PATCH bpf-next 2/2] selftests/bpf: Verify is_extended with multiple freplace links chenyuan_fl
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aa9703467e35f52305c33ee831cfcf56d9b9237ada65eb942e19d44b78451020@mail.kernel.org \
--to=bot+bpf-ci@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=chenyuan@kylinos.cn \
--cc=chenyuan_fl@163.com \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=ihor.solodrai@linux.dev \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@kernel.org \
--cc=martin.lau@linux.dev \
--cc=mason@kernel.org \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=yonghong.song@linux.dev \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®