Bug 8916 - up2date incorrectly computes free disk space
Summary: up2date incorrectly computes free disk space
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: up2date   
(Show other bugs)
Version: 6.1
Hardware: All Linux
Target Milestone: ---
Assignee: Preston Brown
QA Contact:
Depends On:
TreeView+ depends on / blocked
Reported: 2000-01-27 10:43 UTC by Jeffrey Ebert
Modified: 2008-05-01 15:37 UTC (History)
0 users

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

Attachments (Terms of Use)

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.")

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.

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