Patch 6 deserves some explanation, as does patch 7.
For preexisting devices, if there is encryption below the layers we can alter (eg: lvm pvs) we should never ever set the encryption checkbutton sensitive since it is impossible to turn off encryption for such a device without removing it. We already had this covered when setting up the customization area, but I dropped the ball in the on_reformat_toggled handler by not taking this complexity into account.
Patch 7 adds a udev_settle() call at the bottom of udev_trigger. This prevents the possibility of getting into DeviceTree.populate before the udev queue has settled from our trigger call, which could potentially lead to missing info in the udevdb.
--- pyanaconda/storage/formats/fs.py | 14 ++++++++++---- 1 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/storage/formats/fs.py b/pyanaconda/storage/formats/fs.py index a5d8dc7..505e76e 100644 --- a/pyanaconda/storage/formats/fs.py +++ b/pyanaconda/storage/formats/fs.py @@ -1001,8 +1001,11 @@ class Ext2FS(FS): "on %s" % (self.mountType, self.device)) else: orig_size = size - size = min(size * 1.1, size + 500) - log.debug("padding min size from %d up to %d" % (orig_size, size)) + size = min(size * 1.1, size + 500, self.currentSize) + if orig_size < size: + log.debug("padding min size from %d up to %d" % (orig_size, size)) + else: + log.debug("using current size %d as min size" % size)
self._minInstanceSize = size
@@ -1401,8 +1404,11 @@ class NTFS(FS): log.warning("Unable to discover minimum size of filesystem " "on %s" %(self.device,)) else: - size = min(minSize * 1.1, minSize + 500) - log.debug("padding min size from %d up to %d" % (minSize, size)) + size = min(minSize * 1.1, minSize + 500, self.currentSize) + if minSize < size: + log.debug("padding min size from %d up to %d" % (minSize, size)) + else: + log.debug("using current size %d as min size" % size)
self._minInstanceSize = size
--- pyanaconda/ui/gui/spokes/custom.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index 7b1a3f6..c1b6064 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -1205,7 +1205,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): old_device = device
# if the encryption is on member devices it was handled above - if device.exists or factory.encrypt_leaves: + if changed_encryption and (device.exists or factory.encrypt_leaves): if prev_encrypted and not encrypted: log.info("removing encryption from %s" % device.name) with ui_storage_logger():
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index c1b6064..f53d8c7 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -940,8 +940,13 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker): old_mountpoint = getattr(device.format, "mountpoint", "") or "" log.debug("old mountpoint: %s" % old_mountpoint) log.debug("new mountpoint: %s" % mountpoint) - if mountpoint is not None and mountpoint != old_mountpoint: - error = validate_mountpoint(mountpoint, self.__storage.mountpoints.keys()) + if mountpoint is not None and (reformat or + mountpoint != old_mountpoint): + mountpoints = self.__storage.mountpoints.copy() + if old_mountpoint: + del mountpoints[old_mountpoint] + + error = validate_mountpoint(mountpoint, mountpoints.keys()) if error: self._error = _(mountpoint_validation_msgs[error]) self.set_warning(self._error)
--- pyanaconda/storage/__init__.py | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py index 47fb953..4ac19e1 100644 --- a/pyanaconda/storage/__init__.py +++ b/pyanaconda/storage/__init__.py @@ -329,7 +329,7 @@ class Storage(object): iscsi=self.iscsi, dasd=self.dasd) self.fsset = FSSet(self.devicetree) - self.roots = {} + self.roots = [] self.services = set()
def doIt(self):
Related: rhbz#884270 --- pyanaconda/ui/gui/spokes/custom.py | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index f53d8c7..a76444c 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -638,9 +638,10 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
# Make sure the storage spoke execute method has finished before we # copy the storage instance. - t = threadMgr.get("AnaExecuteStorageThread") - if t: - t.join() + for thread_name in ["AnaExecuteStorageThread", "AnaStorageThread"]: + t = threadMgr.get(thread_name) + if t: + t.join()
self.passphrase = self.data.autopart.passphrase self._reset_storage()
The same complicated rules apply when reformat is toggled as when populating the right side. --- pyanaconda/ui/gui/spokes/custom.py | 11 +++++++++++ 1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py index a76444c..000115f 100644 --- a/pyanaconda/ui/gui/spokes/custom.py +++ b/pyanaconda/ui/gui/spokes/custom.py @@ -2234,6 +2234,17 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
encryption_checkbutton = self.builder.get_object("encryptCheckbox") encryption_checkbutton.set_sensitive(active) + if self._current_selector: + device = self._current_selector._device + if device.type == "luks/dm-crypt": + device = device.slave + + ancestors = device.ancestors + ancestors.remove(device) + if any([a.format.type == "luks" and a.format.exists for a in ancestors]): + # The encryption checkbutton should not be sensitive if there is + # existing encryption below the leaf layer. + encryption_checkbutton.set_sensitive(False)
fs_combo = self.builder.get_object("fileSystemTypeCombo") fs_combo.set_sensitive(active)
You always want to let things settle, so just take care of it. --- pyanaconda/baseudev.py | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/pyanaconda/baseudev.py b/pyanaconda/baseudev.py index 3c60348..1e08da8 100644 --- a/pyanaconda/baseudev.py +++ b/pyanaconda/baseudev.py @@ -92,3 +92,4 @@ def udev_trigger(subsystem=None, action="add", name=None): argv.append("--sysname-match=%s" % name)
iutil.execWithRedirect("udevadm", argv, stderr="/dev/null") + udev_settle()
On Wed, Dec 05, 2012 at 05:45:27PM -0600, David Lehman wrote:
Patch 6 deserves some explanation, as does patch 7.
For preexisting devices, if there is encryption below the layers we can alter (eg: lvm pvs) we should never ever set the encryption checkbutton sensitive since it is impossible to turn off encryption for such a device without removing it. We already had this covered when setting up the customization area, but I dropped the ball in the on_reformat_toggled handler by not taking this complexity into account.
Patch 7 adds a udev_settle() call at the bottom of udev_trigger. This prevents the possibility of getting into DeviceTree.populate before the udev queue has settled from our trigger call, which could potentially lead to missing info in the udevdb.
ACK to all of these.
anaconda-patches@lists.fedorahosted.org