Bug 474161 - net-snmp does not use statfs64 on Red Hat Enterprise Linux 4
Summary: net-snmp does not use statfs64 on Red Hat Enterprise Linux 4
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: net-snmp
Version: 4.7
Hardware: All
OS: Linux
medium
medium
Target Milestone: rc
: ---
Assignee: Jan Safranek
QA Contact: BaseOS QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-12-02 15:31 UTC by Olivier Fourdan
Modified: 2018-10-20 01:49 UTC (History)
4 users (show)

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.
Clone Of:
Environment:
Last Closed: 2009-05-18 20:19:09 UTC
Target Upstream Version:
Embargoed:


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


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2009:0984 0 normal SHIPPED_LIVE net-snmp bug fix update 2009-05-18 13:47:15 UTC

Description Olivier Fourdan 2008-12-02 15:31:30 UTC
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 08:39:14 UTC
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 06:26:20 UTC
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 20:19:09 UTC
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.