parted/0087-Fix-resizepart-iec-unit-end-sector.patch
Brian C. Lane d6652ea632 - Use python3 in buildroot
- Add make to BuildRequires
- Switch gpt-header-move and msdos-overlap to python3 (bcl)
- Modify gpt-header-move and msdos-overlap to work with py2 or py3 (bcl)
- Fix atari label false positives (psusi)
- Lift 512 byte restriction on fat resize (psusi)
- build: Remove unused traces of dynamic loading (cjwatson)
- Fix resizepart iec unit end sector (psusi)
- mkpart: Allow negative start value when FS-TYPE is not given (mail)
- Fix set and disk_set to not crash when no flags are supported (psusi)
- tests: fix t6100-mdraid-partitions (psusi)
- Fix make check (psusi)
- linux: Include <sys/sysmacros.h> for major() macro. (rjones)
2018-06-27 14:44:42 -07:00

33 lines
1.2 KiB
Diff

From 247e3fc6cd8bca79b7c0362886ae9b5b06ba6f8c Mon Sep 17 00:00:00 2001
From: Phillip Susi <psusi@ubuntu.com>
Date: Thu, 12 May 2016 21:38:51 -0400
Subject: [PATCH 87/92] Fix resizepart iec unit end sector
Fix resizepart to adjust the end to be -1 sector when using iec
power of 2 units so that the next partition can start immediately
following the new end, just like mkpart does.
---
parted/parted.c | 5 ++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/parted/parted.c b/parted/parted.c
index 88f32b9..267c346 100644
--- a/parted/parted.c
+++ b/parted/parted.c
@@ -1567,8 +1567,11 @@ do_resizepart (PedDevice** dev, PedDisk** diskp)
start = part->geom.start;
end = oldend = part->geom.end;
- if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, NULL))
+ char *end_input;
+ if (!command_line_get_sector (_("End?"), *dev, &end, &range_end, &end_input))
goto error;
+ _adjust_end_if_iec(&start, &end, range_end, end_input);
+ free(end_input);
/* Do not move start of the partition */
constraint = constraint_from_start_end_fixed_start (*dev, start, range_end);
if (!ped_disk_set_partition_geom (disk, part, constraint,
--
2.17.1