From e57fb0dec057be41530dc51436f470a5310ea9c9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 15 Feb 2010 13:29:04 +0100 Subject: [PATCH] fdisk: fallback for topology values Signed-off-by: Karel Zak --- fdisk/fdisk.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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"), -- 2.39.5