]> err.no Git - util-linux/commitdiff
fdisk: fix ALIGN_UP
authorKarel Zak <kzak@redhat.com>
Mon, 15 Feb 2010 13:06:56 +0000 (14:06 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 16 Feb 2010 08:58:58 +0000 (09:58 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fdisk/fdisk.c

index 655bf0c6bcca98f9635bdd8b4113429d2b60a911..55caa0c2db38dd18169b6df86636552fb733bdf4 100644 (file)
@@ -689,6 +689,9 @@ align_lba(unsigned long long lba, int direction)
                        /* fprintf(stderr, "LBA: %llu apply alignment_offset\n", res); */
                        res -= (max(phy_sector_size, min_io_size) -
                                        alignment_offset) / sector_size;
+
+                       if (direction == ALIGN_UP && res < lba)
+                               res += sects_in_phy;
                }
        }