From: Karel Zak Date: Mon, 15 Feb 2010 12:29:04 +0000 (+0100) Subject: fdisk: fallback for topology values X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e57fb0dec057be41530dc51436f470a5310ea9c9;p=util-linux fdisk: fallback for topology values Signed-off-by: Karel Zak --- diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index 0a402bb4..655bf0c6 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -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"),