Bug 8916 - up2date incorrectly computes free disk space
up2date incorrectly computes free disk space
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: up2date (Show other bugs)
6.1
All Linux
medium Severity high
: ---
: ---
Assigned To: Preston Brown
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-01-27 05:43 EST by Jeffrey Ebert
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2000-02-28 11:37:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jeffrey Ebert 2000-01-27 05:43:03 EST
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 11:37:59 EST
thanks for the patch, this will be in the new up2date included with 6.2.

Note You need to log in before you can comment on or make changes to this bug.