[PATCH OLK-6.6] samples/bpf: Fix print issue in dump_partitions()

hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/ICA1GK -------------------------------- BPF_SEQ_PRINTF does not support the %sp format for printing, leading to missing print information, fix it. Fixes: 98e66b4853d4 ("samples/bpf: Add iterator program for partitions") Signed-off-by: Gu Bowen <gubowen5@huawei.com> --- samples/bpf/bpf_rvi/bpf_rvi_partitions.bpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/samples/bpf/bpf_rvi/bpf_rvi_partitions.bpf.c b/samples/bpf/bpf_rvi/bpf_rvi_partitions.bpf.c index 56afe576a789..cffa636be623 100644 --- a/samples/bpf/bpf_rvi/bpf_rvi_partitions.bpf.c +++ b/samples/bpf/bpf_rvi/bpf_rvi_partitions.bpf.c @@ -34,7 +34,7 @@ s64 dump_partitions(struct bpf_iter__partitions *ctx) * Reference: bdev_name() in lib/vsprintf.c */ if (part->bd_partno) - BPF_SEQ_PRINTF(m, "%sp%d\n", part->bd_disk->disk_name, part->bd_partno); + BPF_SEQ_PRINTF(m, "%s%d\n", part->bd_disk->disk_name, part->bd_partno); else BPF_SEQ_PRINTF(m, "%s\n", part->bd_disk->disk_name); -- 2.43.0

反馈: 您发送到kernel@openeuler.org的补丁/补丁集,已成功转换为PR! PR链接地址: https://gitee.com/openeuler/kernel/pulls/18234 邮件列表地址:https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/THL... FeedBack: The patch(es) which you have sent to kernel@openeuler.org mailing list has been converted to a pull request successfully! Pull request link: https://gitee.com/openeuler/kernel/pulls/18234 Mailing list address: https://mailweb.openeuler.org/archives/list/kernel@openeuler.org/message/THL...
participants (2)
-
Gu Bowen
-
patchwork bot