[rhel7-branch 4/6] Avoid exception when aligned start and end are crossed over

dwlehman installerbot-noreply at redhat.com
Fri May 29 17:35:13 UTC 2015


From: Alexander Lakhin <exclusion at gmail.com>

(cherry picked from commit 178c933748692bfae1134e5db4ade014affabf04)

Resolves: rhbz#1167233
---
 blivet/partitioning.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index c429514..ce1e614 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -1733,9 +1733,13 @@ def getDiskChunks(disk, partitions, free):
         # also check that the resulting aligned geometry has a non-zero length.
         # (It is possible that both will align to the same sector in a small
         #  enough region.)
+        al_start = disk.format.alignment.alignUp(f, f.start)
+        al_end = disk.format.endAlignment.alignDown(f, f.end)
+        if al_start >= al_end:
+            continue
         geom = parted.Geometry(device=f.device,
-                               start=disk.format.alignment.alignUp(f, f.start),
-                               end=disk.format.endAlignment.alignDown(f, f.end))
+                               start=al_start,
+                               end=al_end)
         if geom.length < disk.format.alignment.grainSize:
             continue
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/b71863dbfec299172b9b6ff0b2e7e87f45eefaf3


More information about the anaconda-patches mailing list