]> git.ipfire.org Git - thirdparty/util-linux.git/commit
libfidk: (dos) fix tiny partitions calculation
authorKarel Zak <kzak@redhat.com>
Thu, 22 Aug 2019 12:00:32 +0000 (14:00 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 22 Aug 2019 12:00:32 +0000 (14:00 +0200)
commit975b321b5dae3b73346886e4d44fc1e4d6a2862b
tree81db3bb9fd7a28ec2c5507ab0e76443327bb0693
parent8c863d0eacf41958e39845667b3b5f9a541f1ca2
libfidk: (dos) fix tiny partitions calculation

The code uses last_sector -= 1 for tiny partitions. This does not make
sense. This stupidity has been introduced by (my) badly commented commit
09a4ca5e450c5e7cbe860453b76fd68c60fe591f ... sorry.

Fortunately, this issue is visible only for tiny partitions on large
devices (partitions where size < grain; usual grain is 1MiB) if the last
sector is specified by relative notation (+size{siffix}).

Note that "last -= 1" makes sense when the "last" is align to the
optimal I/O boundary; in this case we need to set the end of the
partition one sector before the boundary. For tiny devices it does not
makes sense as we do not align these partitions.

Addresses: https://github.com/karelzak/util-linux/issues/843
Signed-off-by: Karel Zak <kzak@redhat.com>
libfdisk/src/dos.c