Bug 147165 - [RHEL4] net-snmp truncates size of very large filesystems
Summary: [RHEL4] net-snmp truncates size of very large filesystems
Keywords:
Status: CLOSED DUPLICATE of bug 153101
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp
Version: 4.0
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Radek Vokál
QA Contact: David Lawrence
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2005-02-04 16:49 UTC by David Lehman
Modified: 2007-11-30 22:07 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2005-04-04 09:15:22 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description David Lehman 2005-02-04 16:49:37 UTC
*** This bug has been split off bug 147164 ***

------- Original comment by Dave Lehman on 2005.02.04 11:45 -------

Description of problem:
Get_FSSize does the following calculation, casting the return value to a long:
(from agent/mibgroup/host/hr_filesys.c)
786  long
787  Get_FSSize(char *dev)
788  {
...
810                  if (statfs_buf.f_bsize == 512)
811                      return (statfs_buf.f_blocks/2);
812                  else
813                      return (statfs_buf.f_blocks*(statfs_buf.f_bsize/1024));

Since in RHEL4 f_blocks in struct stat can be a 64-bit value, even on 32-bit
platforms where long is 32 bits, this can potentially truncate filesystem size
with large filesystems.


Version-Release number of selected component (if applicable):
net-snmp-5.1.2-11

How reproducible:
Always if you have a partition that is > 4TB or so.

Steps to Reproduce:
1. use the host/hr_partition MIB to display the size of a very large fs
2.
3.
  
Actual results:
Size is truncated

Expected results:
Size is correct

Additional info:

Comment 1 Radek Vokál 2005-04-04 09:15:22 UTC

*** This bug has been marked as a duplicate of 153101 ***


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