Merge lp:~freddebacker/cloud-utils/cloud-utils into lp:cloud-utils

Proposed by Fred De Backer
Status: Merged
Merged at revision: 331
Proposed branch: lp:~freddebacker/cloud-utils/cloud-utils
Merge into: lp:cloud-utils
Diff against target: 12 lines (+1/-1)
1 file modified
bin/growpart (+1/-1)
To merge this branch: bzr merge lp:~freddebacker/cloud-utils/cloud-utils
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Review via email: mp+354305@code.launchpad.net

Description of the change

Fixes https://bugs.launchpad.net/cloud-utils/+bug/1706751.
When growing GPT partitions use [start of next - 1] instead of [start of next] as the new end sector.

To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

@Fred,

Thanks for following up on this.

I took the basic fix and added a test case in revno 331.

I've just now uploaded that to ubuntu cosmic.

Thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/growpart'
2--- bin/growpart 2018-04-13 13:02:00 +0000
3+++ bin/growpart 2018-09-05 09:04:18 +0000
4@@ -444,7 +444,7 @@
5 fail "${dev}: failed to get last usable sector"
6
7 # Find the minimal start sector that is >= pt_end
8- pt_max=$(awk '{ if ($2 >= pt_end && $2 < min) { min = $2 } } END \
9+ pt_max=$(awk '{ if ($2 >= pt_end && $2 < min) { min = $2 - 1 } } END \
10 { print min }' min="${last}" pt_end="${pt_end}" \
11 "${pt_data}") && [ -n "${pt_max}" ] ||
12 fail "${dev}: failed to find max end sector"

Subscribers

People subscribed via source and target branches