- Allow bigger snap radius if cylinders are used as units
(bnc#879387): - add: libparted-allow-bigger-snap-radius-if-cylinders-are-used.patch OBS-URL: https://build.opensuse.org/package/show/Base:System/parted?expand=0&rev=94
This commit is contained in:
parent
5e69bfb129
commit
295facd1e7
@ -0,0 +1,43 @@
|
|||||||
|
From 2ef86fbe0fd8a6c4b48dd8edfbe41728a7343dac Mon Sep 17 00:00:00 2001
|
||||||
|
From: Petr Uzel <petr.uzel@suse.cz>
|
||||||
|
Date: Thu, 29 May 2014 14:50:31 +0200
|
||||||
|
Subject: [PATCH] libparted: allow bigger snap radius if cylinders are used
|
||||||
|
|
||||||
|
This is partial revert of commit
|
||||||
|
|
||||||
|
commit 18e727d492933ae1ebb16961e1df553f9299af8b
|
||||||
|
Author: Brian C. Lane <bcl@redhat.com>
|
||||||
|
Date: Tue Jun 21 10:44:15 2011 -0700
|
||||||
|
|
||||||
|
libparted: fix snap radius so that it is using half (#665496)
|
||||||
|
|
||||||
|
The snap radius didn't match the documentation, it has been
|
||||||
|
using +/- unit size instead +/- 0.5 * unit (eg. 500KB for a MB
|
||||||
|
unit). This caused problems when specifying 1MB, 1GB, etc. as a
|
||||||
|
partition start or end resulting in partitions being created
|
||||||
|
that were nowhere near the specified size.
|
||||||
|
|
||||||
|
Only revert to the old behavior if cylinders are used in order to
|
||||||
|
give parted more flexibility when snapping the partition start/end.
|
||||||
|
|
||||||
|
References: bnc#879387
|
||||||
|
---
|
||||||
|
libparted/unit.c | 5 ++++-
|
||||||
|
1 file changed, 4 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
Index: parted-3.1/libparted/unit.c
|
||||||
|
===================================================================
|
||||||
|
--- parted-3.1.orig/libparted/unit.c
|
||||||
|
+++ parted-3.1/libparted/unit.c
|
||||||
|
@@ -540,7 +540,10 @@ ped_unit_parse_custom (const char* str,
|
||||||
|
}
|
||||||
|
|
||||||
|
unit_size = ped_unit_get_size (dev, unit);
|
||||||
|
- radius = (ped_div_round_up (unit_size, dev->sector_size) / 2) - 1;
|
||||||
|
+ if (unit == PED_UNIT_CYLINDER)
|
||||||
|
+ radius = ped_div_round_up (unit_size, dev->sector_size) - 1;
|
||||||
|
+ else
|
||||||
|
+ radius = (ped_div_round_up (unit_size, dev->sector_size) / 2) - 1;
|
||||||
|
if (radius < 0)
|
||||||
|
radius = 0;
|
||||||
|
/* If the user specifies units in a power of 2, e.g., 4MiB, as in
|
@ -1,3 +1,10 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Thu May 29 12:55:29 UTC 2014 - puzel@suse.com
|
||||||
|
|
||||||
|
- Allow bigger snap radius if cylinders are used as units
|
||||||
|
(bnc#879387):
|
||||||
|
- add: libparted-allow-bigger-snap-radius-if-cylinders-are-used.patch
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Tue May 20 10:27:17 UTC 2014 - puzel@suse.com
|
Tue May 20 10:27:17 UTC 2014 - puzel@suse.com
|
||||||
|
|
||||||
|
@ -58,6 +58,7 @@ Patch30: libparted-initialize-dasd-part-type.patch
|
|||||||
Patch31: libparted-use-BLKRRPART-for-DASD.patch.patch
|
Patch31: libparted-use-BLKRRPART-for-DASD.patch.patch
|
||||||
Patch32: libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch
|
Patch32: libparted-copy-pmbr_boot-when-duplicating-GPT-disk.patch
|
||||||
Patch33: Fix-help-text-for-disk_-set-toggle.patch
|
Patch33: Fix-help-text-for-disk_-set-toggle.patch
|
||||||
|
Patch34: libparted-allow-bigger-snap-radius-if-cylinders-are-used.patch
|
||||||
Patch100: parted-fatresize-autoconf.patch
|
Patch100: parted-fatresize-autoconf.patch
|
||||||
Requires: /sbin/udevadm
|
Requires: /sbin/udevadm
|
||||||
BuildRequires: check-devel
|
BuildRequires: check-devel
|
||||||
@ -138,6 +139,7 @@ to develop applications that require these.
|
|||||||
%patch31 -p1
|
%patch31 -p1
|
||||||
%patch32 -p1
|
%patch32 -p1
|
||||||
%patch33 -p1
|
%patch33 -p1
|
||||||
|
%patch34 -p1
|
||||||
%patch100 -p1
|
%patch100 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
|
Loading…
x
Reference in New Issue
Block a user