From: Eric Sandeen Date: Thu, 17 Sep 2009 21:56:00 +0000 (-0500) Subject: libblkid: fix topology information values X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1db59ad75b7753d360f5d931d89ea177a73a3f84;p=util-linux 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 --- 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);