Bug 474161 - net-snmp does not use statfs64 on Red Hat Enterprise Linux 4
net-snmp does not use statfs64 on Red Hat Enterprise Linux 4
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp (Show other bugs)
4.7
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jan Safranek
BaseOS QE
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-12-02 10:31 EST by Olivier Fourdan
Modified: 2013-03-03 21:47 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
* UCD-SNMP-MIB::dskPercent was based on statfs, which would fail when used on devices larger than 32 terabytes. Net-snmp is now built with support for 64-bit file offsets, and can therefore use statfs64 to calculate disk usage correctly for large devices.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-18 16:19:09 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch for the spec to add -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 (432 bytes, patch)
2008-12-02 10:31 EST, Olivier Fourdan
no flags Details | Diff

  None (edit)
Description Olivier Fourdan 2008-12-02 10:31:30 EST
Created attachment 325382 [details]
Patch for the spec to add -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

Description of problem:

The build of net-snmp provided on Red Hat Enterprise Linux 4 does not use the stat*64 variant.

That causes an error with disks larger than 32Tb.

Version-Release number of selected component (if applicable):

net-snmp-libs-5.1.2-13.2

How reproducible:

100% reproducible

Steps to Reproduce:
1. strace -p $(cat /var/run/snmpd.pid) 2>&1 | grep stat
2. snmpwalk -v 2c localhost -c public UCD-SNMP-MIB::dskPercent

  
Actual results:

statfs("/", {f_type="EXT2_SUPER_MAGIC", ...}) = 0

Expected results:

statfs64("/", 84, {f_type="EXT2_SUPER_MAGIC", ...}) = 0

Additional info:

With disks larger than 32Tb, the statfs() call fails in var_extensible_disk() of agent/mibgroup/ucd-snmp/disk.c

The problem does not happen on Red Hat Enterprise Linux 5 because net-snmp is built with “-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64” while this is not the case on Red Hat Enterprise Linux 4.

One can simulate a disk > 32Tb using device mapper with dm-zero and dm-snapshot but I don't think we ship any filesystem that can handle more than 16Tb on EL4, so the best is to use a kernel that includes jfs to install on top of the 32Tb disk.

Otherwise, use strace as shown above.
Comment 1 Jan Safranek 2008-12-10 03:39:14 EST
I'd fix it in next update. Please note the requested change fixes only dskPercent OID (that's what the IT is about), the other items in dskTable (like dskAvail, dskTotal, ...) will report only 31 bits (Integer32 incl. one bit for sign) and are useless for disks >~2TB.
Comment 4 Ruediger Landmann 2009-01-22 01:26:20 EST
Release note added. If any revisions are required, please set the 
"requires_release_notes" flag to "?" and edit the "Release Notes" field accordingly.
All revisions will be proofread by the Engineering Content Services team.

New Contents:
* UCD-SNMP-MIB::dskPercent was based on statfs, which would fail when used on devices larger than 32 terabytes. Net-snmp is now built with support for 64-bit file offsets, and can therefore use statfs64 to calculate disk usage correctly for large devices.
Comment 6 errata-xmlrpc 2009-05-18 16:19:09 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2009-0984.html

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