]> err.no Git - util-linux/commitdiff
fdisk: fallback for topology values
authorKarel Zak <kzak@redhat.com>
Mon, 15 Feb 2010 12:29:04 +0000 (13:29 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 15 Feb 2010 13:43:33 +0000 (14:43 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisk/fdisk.c

index 0a402bb4d40cf772dc2bbc430483e5768e84e811..655bf0c6bcca98f9635bdd8b4113429d2b60a911 100644 (file)
@@ -990,8 +990,12 @@ get_topology(int fd) {
        else if (blkdev_get_sector_size(fd, &arg) == 0)
                sector_size = arg;
 
+       if (!phy_sector_size)
+               phy_sector_size = sector_size;
+       if (!min_io_size)
+               min_io_size = phy_sector_size;
        if (!io_size)
-               io_size = sector_size;
+               io_size = min_io_size;
 
        if (sector_size != DEFAULT_SECTOR_SIZE)
                printf(_("Note: sector size is %d (not %d)\n"),