From f6a34526c11cba661cb2d84b417f4dec36de77e3 Mon Sep 17 00:00:00 2001 From: David Lehman Date: Wed, 20 Aug 2014 14:22:19 -0500 Subject: [PATCH 3/7] Improve adjustment for removal of a subvol in BTRFSFactory. Resolves: rhbz#1078995 --- blivet/devicefactory.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py index 7926d39..fbc2231 100644 --- a/blivet/devicefactory.py +++ b/blivet/devicefactory.py @@ -1626,8 +1626,11 @@ class BTRFSFactory(DeviceFactory): if self.container_size == SIZE_POLICY_AUTO: # automatic if self.container and not self.device: - # For new subvols the size is in addition to the volume's size. - size += self.container.size + if self.size != 0: + # For new subvols the size is in addition to the volume's size. + size += self.container.size + else: + size += sum(s.req_size for s in self.container.subvolumes) size += self._get_device_space() elif self.container_size == SIZE_POLICY_MAX: -- 1.9.3