libblkid: topology/ioctl: correctly handle kernel types
authorThomas Weißschuh <thomas@t-8ch.de>
Tue, 2 Apr 2024 16:55:29 +0000 (18:55 +0200)
committerChris Hofstaedtler <zeha@debian.org>
Sat, 27 Apr 2024 12:23:31 +0000 (14:23 +0200)
commitdf169b1a08b886ccf87187c76615bdfa2c9a1f82
tree75163036d05634cd3b65162985c26d143efd9c38
parent145509bed6e66817399aeeb59c2f0b70781a986e
libblkid: topology/ioctl: correctly handle kernel types

Commit 5d71d711d07a ("libblkid: topolicy/ioctl: use union for multiple data types")
incorrectly assumed that set_ulong and set_int refer to the type
returned by the kernel. Instead the different function pointer names
refer to the types of the function pointers.
However all ioctls, except for the later added BLKGETDISKSEQ, return
32bit integers.
This made libblkid also interpret the upper 32bits too, leading to
garbage values.

Introduce a new member 'kernel_size' to also handle the 64bit
BLKGETDISKSEQ.

Drop data.ul as it is no actually used.

Closes #2904
Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
(cherry picked from commit a10081a52c48a5232db30d8e0a7a7570cc8163ae)

Gbp-Pq: Topic upstream
Gbp-Pq: Name libblkid-topology-ioctl-correctly-handle-kernel-types.patch
libblkid/src/topology/ioctl.c