From 1db59ad75b7753d360f5d931d89ea177a73a3f84 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Thu, 17 Sep 2009 16:56:00 -0500 Subject: [PATCH] libblkid: fix topology information values 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 --- shlibs/blkid/src/topology/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shlibs/blkid/src/topology/topology.c b/shlibs/blkid/src/topology/topology.c index 8ebd5b08..b4240543 100644 --- a/shlibs/blkid/src/topology/topology.c +++ b/shlibs/blkid/src/topology/topology.c @@ -160,7 +160,7 @@ dev_topology_attribute(const char *attribute, dev_t dev, dev_t *primary) DBG(DEBUG_LOWPROBE, printf("topology: attribute %s = %lu (sectors)\n", attribute, result)); - return result * DEFAULT_SECTOR_SIZE; + return result; err: if (fp) fclose(fp); -- 2.39.5