Looks like the topology values returned are being
inflated by x 512, but the kernel reports them in bytes;
no need for the multiplication, just return the value as-is.
With the patch it all matches:
# mdadm -D /dev/md0 | grep Chunk
Chunk Size : 64K
# cat /sys/devices/virtual/block/md0/queue/minimum_io_size
65536
# blkid/samples/topology /dev/md0
----- NAME=value interface (values: 0):
MINIMUM_IO_SIZE = 65536
OPTIMAL_IO_SIZE = 131072
----- binary interface:
alignment offset : 0
minimum io size : 65536
optimal io size : 131072
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
DBG(DEBUG_LOWPROBE,
printf("topology: attribute %s = %lu (sectors)\n", attribute, result));
- return result * DEFAULT_SECTOR_SIZE;
+ return result;
err:
if (fp)
fclose(fp);