From c9e0808376d99f3eec4da6f101cc419d8d7c4747 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Fri, 12 Jun 2026 16:09:25 -0700 Subject: [PATCH] partition_table: Make AlignUp clearer The way AlignUp was originally written depends on the rounding of the go data types in order to function. This changes it to remove the division and multiplication. --- pkg/disk/partition_table.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/disk/partition_table.go b/pkg/disk/partition_table.go index b6508fe278..e8c300990e 100644 --- a/pkg/disk/partition_table.go +++ b/pkg/disk/partition_table.go @@ -251,7 +251,7 @@ func (pt *PartitionTable) AlignUp(size datasizes.Size) datasizes.Size { // already aligned: return unchanged return size } - return ((size + grain) / grain) * grain + return (size - (size % grain)) + grain } // Convert the given bytes to the number of sectors.