Tools: fix mdflush

Include blkdev.h instead of genhd.h

Resolves: rhbz#2108001
This commit is contained in:
Jerome Marchand 2022-08-23 11:18:08 +02:00
parent b6f327fcd1
commit 54d6fada7d
2 changed files with 35 additions and 1 deletions

View File

@ -0,0 +1,30 @@
From 93a464e2ef05b7ef78b5679e366b89fcddf6a575 Mon Sep 17 00:00:00 2001
From: Jerome Marchand <jmarchan@redhat.com>
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 <uapi/linux/ptrace.h>
#include <linux/sched.h>
-#include <linux/genhd.h>
+#include <linux/blkdev.h>
#include <linux/bio.h>
struct data_t {
--
2.37.1

View File

@ -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 <jmarchan@redhat.com> - 0.24.1-4
- Fix mdflush tool (rhbz#2108001)
* Fri Jul 01 2022 Jerome Marchand <jmarchan@redhat.com> - 0.24.1-3
- Rebuild for libbpf 0.6.0