[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 2/4] growPartitions: Change op_func (back to) add when an iteration succeeds



Currently when an iteration fails we will switch from growing to
shrinking our req_size, but we neglect to switch back to growing when we
succeed. So if for example orig_sectors + 1/2 max_grow would fail, we
would try orig_sectors + 1/4 max_grow and even if that succeeds we would
then try orig_sectors + 1/8 max_grow (and keep that) instead of trying
orig_sectors + 3/8 max_grow.
---
 storage/partitioning.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/storage/partitioning.py b/storage/partitioning.py
index 6328de1..e8fee31 100644
--- a/storage/partitioning.py
+++ b/storage/partitioning.py
@@ -987,6 +987,7 @@ def growPartitions(disks, partitions):
                     op_func = sub
                     last_outcome = False
                 else:
+                    op_func = add
                     last_good_size = part.req_size
                     last_outcome = True
 
-- 
1.6.2


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]