summaryrefslogtreecommitdiffstats
path: root/autopart.py
diff options
context:
space:
mode:
authorMike Fulbright <msf@redhat.com>2003-01-14 05:03:45 +0000
committerMike Fulbright <msf@redhat.com>2003-01-14 05:03:45 +0000
commit78df9af2edd6f35ae3f070172cb8ec8bd7412d32 (patch)
tree49f46fe19f5252bf1ed2b3f8a435a09780f5a847 /autopart.py
parent836d05ea0be3a78fd4eb5936d4f255381b2b471b (diff)
downloadanaconda-78df9af2edd6f35ae3f070172cb8ec8bd7412d32.tar.gz
anaconda-78df9af2edd6f35ae3f070172cb8ec8bd7412d32.tar.xz
anaconda-78df9af2edd6f35ae3f070172cb8ec8bd7412d32.zip
a fix to address bug #80972 - swap could grow up to 2TB limit!
Diffstat (limited to 'autopart.py')
-rw-r--r--autopart.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/autopart.py b/autopart.py
index f7156908e..9bdb7561a 100644
--- a/autopart.py
+++ b/autopart.py
@@ -708,7 +708,25 @@ def growParts(diskset, requests, newParts):
if maxsect > maxUserSize:
maxsect = long(maxUserSize)
imposedMax = 1
+
+ else:
+ # XXX HACK enforce silent limit for swap otherwise it
+ # can grow up to 2TB!
+ if request.fstype.name == "swap":
+ (xxxint, tmpint) = iutil.swapSuggestion(quiet=1)
+
+ # convert to sectors
+ tmpint = tmpint*1024*1024/sector_size
+ tmpint = long(tmpint / cylsectors)
+ maxsugswap = tmpint * cylsectors
+ userstartsize = origSize[request.uniqueID]*1024*1024/sector_size
+ if maxsugswap >= userstartsize:
+ maxsect = maxsugswap
+ imposedMax = 1
+ log("Enforced max swap size of %s based on suggested max swap", maxsect)
+
+
# round max fs limit down a cylinder, helps when growing
# so we don't end up with a free cylinder at end if
# maxlimit fell between cylinder boundaries