From 54d6fada7d75bfaac6699723fcba54c5b75ec39e Mon Sep 17 00:00:00 2001 From: Jerome Marchand Date: Tue, 23 Aug 2022 11:18:08 +0200 Subject: [PATCH] Tools: fix mdflush Include blkdev.h instead of genhd.h Resolves: rhbz#2108001 --- ...-include-blkdev.h-instead-of-genhd.h.patch | 30 +++++++++++++++++++ bcc.spec | 6 +++- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 bcc-0.24.0-tools-mdflush-include-blkdev.h-instead-of-genhd.h.patch diff --git a/bcc-0.24.0-tools-mdflush-include-blkdev.h-instead-of-genhd.h.patch b/bcc-0.24.0-tools-mdflush-include-blkdev.h-instead-of-genhd.h.patch new file mode 100644 index 0000000..18edfb4 --- /dev/null +++ b/bcc-0.24.0-tools-mdflush-include-blkdev.h-instead-of-genhd.h.patch @@ -0,0 +1,30 @@ +From 93a464e2ef05b7ef78b5679e366b89fcddf6a575 Mon Sep 17 00:00:00 2001 +From: Jerome Marchand +Date: Mon, 1 Aug 2022 11:45:41 +0200 +Subject: [PATCH] tools/mdflush: include blkdev.h instead of genhd.h + +In recent kernels, i.e. since commit 322cbb50de71 ("block: remove +genhd.h"), genhd.h header has been removed and its content moved to +blkdev.h. Since genhd.h has been included in blkdev.h since forever, +including blkdev instead of genhd in the mdflush tool works for both +older and newer kernel. +--- + tools/mdflush.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/tools/mdflush.py b/tools/mdflush.py +index 3581d1bf..6741d563 100755 +--- a/tools/mdflush.py ++++ b/tools/mdflush.py +@@ -19,7 +19,7 @@ from time import strftime + b = BPF(text=""" + #include + #include +-#include ++#include + #include + + struct data_t { +-- +2.37.1 + diff --git a/bcc.spec b/bcc.spec index 3027312..42396df 100644 --- a/bcc.spec +++ b/bcc.spec @@ -25,7 +25,7 @@ Name: bcc Version: 0.24.0 -Release: 3%{?dist} +Release: 4%{?dist} Summary: BPF Compiler Collection (BCC) License: ASL 2.0 URL: https://github.com/iovisor/bcc @@ -38,6 +38,7 @@ Patch4: %{name}-%{version}-Revert-libbpf-1.0-changes.patch Patch5: %{name}-%{version}-C9S-Fix-mdflush.patch Patch6: %{name}-%{version}-biolatency-biolatpcts-biosnoop-biotop-Build-fix-for-.patch Patch7: %{name}-%{version}-libbpf-tools-Fix-dropped-request-rq_disk-for-kernel-.patch +Patch8: %{name}-%{version}-tools-mdflush-include-blkdev.h-instead-of-genhd.h.patch # Arches will be included as upstream support is added and dependencies are # satisfied in the respective arches @@ -261,6 +262,9 @@ cp -a libbpf-tools/tmp-install/bin/* %{buildroot}/%{_sbindir}/ %endif %changelog +* Tue Aug 23 2022 Jerome Marchand - 0.24.1-4 +- Fix mdflush tool (rhbz#2108001) + * Fri Jul 01 2022 Jerome Marchand - 0.24.1-3 - Rebuild for libbpf 0.6.0