[blivet][f21] Avoid alignment-related resize snafus (#1120964)

David Lehman dlehman at redhat.com
Tue Oct 28 19:19:57 UTC 2014


We currently align the end sector of partitions when resizing them.
Without these patches, that can cause problems because the alignment
changes the target size without propagating the change to related
actions (eg: resize of filesystem on the partition). This means it is
possible to have the alignment knock the partition's target size down
below the target size for the filesystem, which leads to a corrupt fs.

The approach taken is to require that all resize target sizes account
for alignment. We provide a method to make this easy. Trying to set a
new target size that would yield an unaligned partition will result in
a ValueError. We also change minSize and maxSize to always return a size
that is acceptable in terms of alignment.

David Lehman (6):
  Check new target size against min size and max size.
  Specify ntfs resize target in bytes. (#1120964)
  Align end sector in the appropriate direction for resize. (#1120964)
  Allow generating aligned geometry for arbitrary target size.
  Split out code to determine max unaligned partition size to a
    property.
  Require resize target sizes to yield aligned partitions. (#1120964)

 blivet/devices/partition.py |  86 ++++++++++++++++++++++++++++++---
 blivet/devices/storage.py   |  21 +++++++-
 blivet/formats/fs.py        |   3 +-
 tests/devices_test.py       | 115 ++++++++++++++++++++++++++++++++++++++++++++
 tests/storagetestcase.py    |   2 +
 5 files changed, 215 insertions(+), 12 deletions(-)

-- 
1.9.3



More information about the anaconda-patches mailing list