Blame SOURCES/bcc-0.24.0-C9S-Fix-mdflush.patch

f5d2bd
From 5e7543d35596fabd9e5b02b58f8910bf572ca2fa Mon Sep 17 00:00:00 2001
c04935
From: Jerome Marchand <jmarchan@redhat.com>
c04935
Date: Thu, 7 Oct 2021 17:31:53 +0200
f5d2bd
Subject: [PATCH] C9S: Fix mdflush
c04935
c04935
Since kernel commit 309dca309fc ("block: store a block_device pointer
c04935
in struct bio") struct bio points again to a block_device and not to a
c04935
gendisk directly. However mdflush is looking at the presence or not of
c04935
the bio_dev macro to check whether to get the gendisk directly from
c04935
the bio or not, which doesn't work anymore since the bio_dev macro
c04935
still exists. Since we don't have to deal other ekrnel kernel version
c04935
but our own, just use the definition that we use in our kernels.
f5d2bd
f5d2bd
Signed-off-by: Jerome Marchand <jmarchan@redhat.com>
c04935
---
c04935
 tools/mdflush.py | 11 -----------
c04935
 1 file changed, 11 deletions(-)
c04935
c04935
diff --git a/tools/mdflush.py b/tools/mdflush.py
f5d2bd
index 8a23520b..3581d1bf 100755
c04935
--- a/tools/mdflush.py
c04935
+++ b/tools/mdflush.py
c04935
@@ -35,18 +35,7 @@ int kprobe__md_flush_request(struct pt_regs *ctx, void *mddev, struct bio *bio)
f5d2bd
     u32 pid = bpf_get_current_pid_tgid() >> 32;
c04935
     data.pid = pid;
c04935
     bpf_get_current_comm(&data.comm, sizeof(data.comm));
c04935
-/*
c04935
- * The following deals with a kernel version change (in mainline 4.14, although
c04935
- * it may be backported to earlier kernels) with how the disk name is accessed.
c04935
- * We handle both pre- and post-change versions here. Please avoid kernel
c04935
- * version tests like this as much as possible: they inflate the code, test,
c04935
- * and maintenance burden.
c04935
- */
c04935
-#ifdef bio_dev
c04935
-    struct gendisk *bi_disk = bio->bi_disk;
c04935
-#else
c04935
     struct gendisk *bi_disk = bio->bi_bdev->bd_disk;
c04935
-#endif
c04935
     bpf_probe_read_kernel(&data.disk, sizeof(data.disk), bi_disk->disk_name);
c04935
     events.perf_submit(ctx, &data, sizeof(data));
c04935
     return 0;
c04935
-- 
f5d2bd
2.35.1
c04935