Bug 440057 - "nfsstat -s" shows negative value
"nfsstat -s" shows negative value
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: nfs-utils (Show other bugs)
5.2
All Linux
medium Severity medium
: rc
: ---
Assigned To: Jeff Layton
:
: 447530 (view as bug list)
Depends On:
Blocks: 404831
  Show dependency treegraph
 
Reported: 2008-04-01 11:23 EDT by Jeff Layton
Modified: 2009-01-20 16:01 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-01-20 16:01:25 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)
backported patch (1007 bytes, patch)
2008-07-11 07:22 EDT, Jeff Layton
no flags Details | Diff

  None (edit)
Description Jeff Layton 2008-04-01 11:23:38 EDT
+++ This bug was initially created as a clone of Bug #404831 +++

Description of problem:
"nfsstat -s" shows negative value.

How reproducible:
When nfsd has taken enough calls to overflow a signed int.

Steps to Reproduce:
Run nfsd service for a long time with many clients doing operations, and 
run "nfsstat -s".

# nfsstat -s
   2007年 10月 24日 水曜日 05:29:02 JST
   Server rpc stats:
   calls      badcalls   badauth    badclnt    xdrcall
>> -2147459460   0          0          0          0         
   Server nfs v3:
   null       getattr    setattr    lookup     access     readlink   
   3       0% 961806770 44% 34884113  1% 356848932 16% 311303203 14% 0  0% 
   read       write      create     mkdir      symlink    mknod      
   58992809  2% 63067804  2% 69266297  3% 12816   0% 0       0% 0       0% 
   remove     rmdir      rename     link       readdir    readdirplus
   103983458  4% 2808    0% 5945055  0% 36564688  1% 34420909  1% 73349994  3% 
   fsstat     fsinfo     pathconf   commit     
   31820   0% 177     0% 0       0% 36532676  1% 

Actual results:
"nfsstat -s" shows negative value.

Expected results:
"nfsstat -s" shows correct value.

Additional info:
/proc/net/rpc/nfsd formats its value as an unsigned int, but nfsstat parses 
this unsigned int with atoi(). It should use atoll().

-- Additional comment from fleite@redhat.com on 2007-11-29 13:51 EST --
Created an attachment (id=273161)
Patch to parse and print values correctly.


-- Additional comment from fleite@redhat.com on 2007-11-29 13:52 EST --
Very simple fix, hope it still makes 4.7.

-- Additional comment from pm-rhel@redhat.com on 2007-11-29 13:54 EST --
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

-- Additional comment from jlayton@redhat.com on 2008-01-04 10:18 EST --
Looks simple enough...


-- Additional comment from jlayton@redhat.com on 2008-04-01 10:46 EST --
This patch is not upstream and needs to go there first. I'm going to reset this
for 4.8 and we can consider it there. We'll also need to clone this for 5.2.


-- Additional comment from jlayton@redhat.com on 2008-04-01 10:59 EST --
...err make that 5.3...


-- Additional comment from jlayton@redhat.com on 2008-04-01 11:15 EST --
As far as testing this...

The easiest thing might be to custom roll a kernel that initializes the /proc
fields to values that would cause this. I'll plan to do that to verify the fix
and will post the kernel patch here so that QA can use it too...
Comment 1 Jeff Layton 2008-04-01 11:24:18 EDT
RHEL5 has the same code and will likely need the same patch.
Comment 2 RHEL Product and Program Management 2008-06-02 16:11:10 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 4 Jeff Layton 2008-07-11 07:20:14 EDT
Patch committed in nfs-utils-1.0.9-34.el5
Comment 5 Jeff Layton 2008-07-11 07:22:58 EDT
Created attachment 311562 [details]
backported patch

The upstream patch had a delta that wasn't needed for RHEL5. This is the
backport of the upstream version.
Comment 6 Jeff Layton 2008-07-11 07:24:42 EDT
*** Bug 447530 has been marked as a duplicate of this bug. ***
Comment 10 errata-xmlrpc 2009-01-20 16:01:25 EST
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-0107.html

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