[DTrace-devel] [PATCH] dlibs: fix access to `major_names data

Kris Van Hees kris.van.hees at oracle.com
Fri Jul 26 19:35:49 UTC 2024


On systems that lack CTF data, all kernel variable have a default type of
uintptr_t.  That means that an explicit &-operator needs to be applied
is the kernel variable is e.g. the address of an array because it will not
be recognized as a ref-type.

Fix this for `major_names access in the io translators.

Signed-off-by: Kris Van Hees <kris.van.hees at oracle.com>
---
 dlibs/aarch64/5.11/io.d | 2 +-
 dlibs/aarch64/5.12/io.d | 2 +-
 dlibs/aarch64/5.14/io.d | 2 +-
 dlibs/aarch64/5.16/io.d | 2 +-
 dlibs/aarch64/5.2/io.d  | 2 +-
 dlibs/aarch64/5.6/io.d  | 2 +-
 dlibs/aarch64/6.1/io.d  | 2 +-
 dlibs/aarch64/6.10/io.d | 2 +-
 dlibs/x86_64/5.11/io.d  | 2 +-
 dlibs/x86_64/5.12/io.d  | 2 +-
 dlibs/x86_64/5.14/io.d  | 2 +-
 dlibs/x86_64/5.16/io.d  | 2 +-
 dlibs/x86_64/5.2/io.d   | 2 +-
 dlibs/x86_64/5.6/io.d   | 2 +-
 dlibs/x86_64/6.1/io.d   | 2 +-
 dlibs/x86_64/6.10/io.d  | 2 +-
 16 files changed, 16 insertions(+), 16 deletions(-)

diff --git a/dlibs/aarch64/5.11/io.d b/dlibs/aarch64/5.11/io.d
index b1958418..c153d5a2 100644
--- a/dlibs/aarch64/5.11/io.d
+++ b/dlibs/aarch64/5.11/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_disk == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_disk == NULL ? "nfs" :
diff --git a/dlibs/aarch64/5.12/io.d b/dlibs/aarch64/5.12/io.d
index 8c2830cd..09968d5a 100644
--- a/dlibs/aarch64/5.12/io.d
+++ b/dlibs/aarch64/5.12/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/aarch64/5.14/io.d b/dlibs/aarch64/5.14/io.d
index 8c2830cd..09968d5a 100644
--- a/dlibs/aarch64/5.14/io.d
+++ b/dlibs/aarch64/5.14/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/aarch64/5.16/io.d b/dlibs/aarch64/5.16/io.d
index 8c2830cd..09968d5a 100644
--- a/dlibs/aarch64/5.16/io.d
+++ b/dlibs/aarch64/5.16/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/aarch64/5.2/io.d b/dlibs/aarch64/5.2/io.d
index 972917fb..5111df28 100644
--- a/dlibs/aarch64/5.2/io.d
+++ b/dlibs/aarch64/5.2/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_disk == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
 				   ]->name);
 	dev_statname = B->bi_disk == NULL ? "nfs" :
diff --git a/dlibs/aarch64/5.6/io.d b/dlibs/aarch64/5.6/io.d
index 972917fb..5111df28 100644
--- a/dlibs/aarch64/5.6/io.d
+++ b/dlibs/aarch64/5.6/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_disk == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
 				   ]->name);
 	dev_statname = B->bi_disk == NULL ? "nfs" :
diff --git a/dlibs/aarch64/6.1/io.d b/dlibs/aarch64/6.1/io.d
index 8c2830cd..09968d5a 100644
--- a/dlibs/aarch64/6.1/io.d
+++ b/dlibs/aarch64/6.1/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/aarch64/6.10/io.d b/dlibs/aarch64/6.10/io.d
index ffccf5b3..d6cb0c83 100644
--- a/dlibs/aarch64/6.10/io.d
+++ b/dlibs/aarch64/6.10/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/x86_64/5.11/io.d b/dlibs/x86_64/5.11/io.d
index a9f718dd..ae4b62c3 100644
--- a/dlibs/x86_64/5.11/io.d
+++ b/dlibs/x86_64/5.11/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_disk == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_disk == NULL ? "nfs" :
diff --git a/dlibs/x86_64/5.12/io.d b/dlibs/x86_64/5.12/io.d
index 3101a4ec..0432b02c 100644
--- a/dlibs/x86_64/5.12/io.d
+++ b/dlibs/x86_64/5.12/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/x86_64/5.14/io.d b/dlibs/x86_64/5.14/io.d
index 3101a4ec..0432b02c 100644
--- a/dlibs/x86_64/5.14/io.d
+++ b/dlibs/x86_64/5.14/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/x86_64/5.16/io.d b/dlibs/x86_64/5.16/io.d
index 3101a4ec..0432b02c 100644
--- a/dlibs/x86_64/5.16/io.d
+++ b/dlibs/x86_64/5.16/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/x86_64/5.2/io.d b/dlibs/x86_64/5.2/io.d
index 20b6c3a9..415bbb4c 100644
--- a/dlibs/x86_64/5.2/io.d
+++ b/dlibs/x86_64/5.2/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_disk == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
 				   ]->name);
 	dev_statname = B->bi_disk == NULL ? "nfs" :
diff --git a/dlibs/x86_64/5.6/io.d b/dlibs/x86_64/5.6/io.d
index 20b6c3a9..415bbb4c 100644
--- a/dlibs/x86_64/5.6/io.d
+++ b/dlibs/x86_64/5.6/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_disk == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_disk->part_tbl->part[B->bi_partno]->__dev.devt) % 255
 				   ]->name);
 	dev_statname = B->bi_disk == NULL ? "nfs" :
diff --git a/dlibs/x86_64/6.1/io.d b/dlibs/x86_64/6.1/io.d
index 3101a4ec..0432b02c 100644
--- a/dlibs/x86_64/6.1/io.d
+++ b/dlibs/x86_64/6.1/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
diff --git a/dlibs/x86_64/6.10/io.d b/dlibs/x86_64/6.10/io.d
index de693c18..d67181b4 100644
--- a/dlibs/x86_64/6.10/io.d
+++ b/dlibs/x86_64/6.10/io.d
@@ -131,7 +131,7 @@ translator devinfo_t < struct bio *B > {
 	dev_instance = 0;
 	dev_name = B->bi_bdev == NULL
 			? "nfs"
-			: stringof(((struct blk_major_name **)`major_names)[
+			: stringof(((struct blk_major_name **)&`major_names)[
 					getmajor(B->bi_bdev->bd_dev) % 255
 				   ]->name);
 	dev_statname = B->bi_bdev == NULL ? "nfs" :
-- 
2.45.2




More information about the DTrace-devel mailing list