Bug 8916

Summary: up2date incorrectly computes free disk space
Product: [Retired] Red Hat Linux Reporter: Jeffrey Ebert <j--redhat>
Component: up2dateAssignee: Preston Brown <pbrown>
Status: CLOSED RAWHIDE QA Contact:
Severity: high Docs Contact:
Priority: medium    
Version: 6.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2000-02-28 16:37:04 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Jeffrey Ebert 2000-01-27 10:43:03 UTC
The up2date client tries to check the free disk space, but it assumes that
the block size of the fs is always 1024 bytes. This is not the case on my
system. (In fact, I just accepted redhat's default of 4096 when I created
the partition.)

Here's a patch:

--- client.py.orig	Wed Nov  3 12:21:48 1999
+++ client.py	Thu Jan 27 02:24:41 2000
@@ -598,8 +598,9 @@

 	self.addReply("total size of packages: %s kbytes" % totalSize, 0, 1)
 	dfInfo = os.statvfs(self.cfg.readEntry("storageDir"))
-	self.addReply("free space available: %s kbytes" %
dfInfo[statvfs.F_BAVAIL], 0, 1)
-	if dfInfo[statvfs.F_BAVAIL] < totalSize:
+	freeSpace = dfInfo[statvfs.F_BAVAIL] * dfInfo[statvfs.F_BSIZE]
+	self.addReply("free space available: %s kbytes" % freeSpace, 0, 1)
+	if freeSpace < totalSize:
 	    if not self.gui:
 		self.addReply("Not enough free disk space to proceed.")
 	    else:


I'm not sure if the multiplier should be statvfs.F_BSIZE or
statvfs.F_FRSIZE. On my system, they are both 4096, so I don't care.

Thanks using python!

-Jeff Ebert

Comment 1 Preston Brown 2000-02-28 16:37:59 UTC
thanks for the patch, this will be in the new up2date included with 6.2.