util-linux-2.39.3-1: libblkid returns invalid physical_sector_size

Christian Franke Christian.Franke@t-online.de
Tue Apr 2 09:27:55 GMT 2024


Hi Mark,

Mark Geisert via Cygwin wrote:
> Hi Christian,
>
> On 3/31/2024 1:11 AM, Christian Franke via Cygwin wrote:
>> Testcase:
>>
>> # cygcheck -f /sbin/fdisk.exe
>> util-linux-2.39.3-1
>>
>> # /sbin/fdisk.exe -l /dev/sdd
>> Disk /dev/sdd: 465.76 GiB, 500107862016 bytes, 976773168 sectors
>> Units: sectors of 1 * 512 = 512 bytes
>> Sector size (logical/physical): 512 bytes / 34359738880 bytes
>> I/O size (minimum/optimal): 34359738880 bytes / 34359738880 bytes
> [...valuable investigation and patch suggestion elided...]
>
> Your suggested patch looks fine to me.  I have added it to the patch 
> deck for a new util-linux 2.39.3-2, which has just been uploaded.  The 
> patch allows fdisk.exe to report the three correct values in my 
> limited testing.
> Thanks for the report and the patch!

You're welcome.

BTW, according to the Linux kernel sources, BLKPBSZGET etc return 
'unsigned int' and not 'unsigned long' since first appearance in 
2.6.32-rc3 (2009?):

https://elixir.bootlin.com/linux/v2.6.32-rc3/source/block/ioctl.c#L276
https://elixir.bootlin.com/linux/v2.6.32-rc3/source/block/compat_ioctl.c#L743
https://elixir.bootlin.com/linux/v6.8.2/source/block/ioctl.c#L533

So I don't understand why the mentioned code would be correct for Linux.



More information about the Cygwin mailing list