From: Nick Alcock <nick.alcock@oracle.com>
To: Kris Van Hees <kris.van.hees@oracle.com>
Cc: dtrace@lists.linux.dev, dtrace-devel@oss.oracle.com
Subject: Re: [PATCH] dlibs: fix access to `major_names data
Date: Mon, 29 Jul 2024 16:27:40 +0100 [thread overview]
Message-ID: <87ikwousk3.fsf@esperi.org.uk> (raw)
In-Reply-To: <SN7PR10MB6287FF4B1172CD80B733E84BC2B42@SN7PR10MB6287.namprd10.prod.outlook.com> (Kris Van Hees's message of "Fri, 26 Jul 2024 15:35:49 -0400")
On 26 Jul 2024, Kris Van Hees outgrape:
> 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.
Ugh. Nasty, and presumably every *other* translator doing a stringof
might have this problem too. (But most are unaffected because they're
doing struct derefs or other things that need the types in scope
anyway.)
> 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" :
I wish this wasn't necessary, and hope that in the future we can reverse
it, but at least it's minimally invasive:
Reviewed-by: Nick Alcock <nick.alcock@oracle.com>
prev parent reply other threads:[~2024-07-29 15:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-26 19:35 [PATCH] dlibs: fix access to `major_names data Kris Van Hees
2024-07-29 15:27 ` Nick Alcock [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87ikwousk3.fsf@esperi.org.uk \
--to=nick.alcock@oracle.com \
--cc=dtrace-devel@oss.oracle.com \
--cc=dtrace@lists.linux.dev \
--cc=kris.van.hees@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.