Skip to content

Commit

Permalink
Don't crash when a free region is too small for an aligned partition.
Browse files Browse the repository at this point in the history
(cherry picked from commit dcfd06a)

Resolves: rhbz#1167292
  • Loading branch information
dwlehman committed May 29, 2015
1 parent b71863d commit 03222fe
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions blivet/partitioning.py
Expand Up @@ -1096,12 +1096,18 @@ def allocatePartitions(storage, disks, partitions, freespace):

continue

temp_part = addPartition(disklabel,
_free,
_part_type,
_part.req_size,
_part.req_start_sector,
_part.req_end_sector)
try:
temp_part = addPartition(disklabel,
_free,
_part_type,
_part.req_size,
_part.req_start_sector,
_part.req_end_sector)
except ArithmeticError as e:
log.debug("failed to allocate aligned partition "
"for growth test")
continue

_part.partedPartition = temp_part
_part.disk = _disk
temp_parts.append(_part)
Expand Down

0 comments on commit 03222fe

Please sign in to comment.