Bug 625080
| Summary: | nfsstat: has_stats() does not function correctly for NFSv4 client stats | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 6 | Reporter: | Harshula Jayasuriya <harshula> | ||||||
| Component: | nfs-utils | Assignee: | Steve Dickson <steved> | ||||||
| Status: | CLOSED ERRATA | QA Contact: | yanfu,wang <yanwang> | ||||||
| Severity: | low | Docs Contact: | |||||||
| Priority: | low | ||||||||
| Version: | 6.0 | CC: | moshiro, myamazak, skito, syeghiay, tao | ||||||
| Target Milestone: | rc | Keywords: | RHELNAK | ||||||
| Target Release: | 6.1 | ||||||||
| Hardware: | All | ||||||||
| OS: | Linux | ||||||||
| Whiteboard: | |||||||||
| Fixed In Version: | nfs-utils-1.2.3-4.el6 | Doc Type: | Bug Fix | ||||||
| Doc Text: |
The "nfsstat --nfs" command did not return any results for NFS version 4 clients because the has_stats() function did not support statistics for the NFS version 4 clients. This update adapts the underlying code and the command returns the values as expected.
|
Story Points: | --- | ||||||
| Clone Of: | Environment: | ||||||||
| Last Closed: | 2011-05-19 14:16:39 UTC | Type: | --- | ||||||
| Regression: | --- | Mount Type: | --- | ||||||
| Documentation: | --- | CRM: | |||||||
| Verified Versions: | Category: | --- | |||||||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
| Cloudforms Team: | --- | Target Upstream Version: | |||||||
| Embargoed: | |||||||||
| Bug Depends On: | |||||||||
| Bug Blocks: | 580566, 627601 | ||||||||
| Attachments: |
|
||||||||
Created attachment 439405 [details]
nfs-utils-nfsstat-fix-CLTPROC4-and-manpage.patch
This issue has been proposed when we are only considering blocker issues in the current Red Hat Enterprise Linux release. ** If you would still like this issue considered for the current release, ask your support representative to file as a blocker on your behalf. Otherwise ask that it be considered for the next Red Hat Enterprise Linux release. ** Fixed by:
commit 7f77ef90ad52eced1552efc2242e063aa4501ddc
Author: Benny Halevy <bhalevy>
Date: Tue Jul 20 08:40:34 2010 +0300
nfsstat: add release_lockowner to client stats
Signed-off-by: Benny Halevy <bhalevy>
Hi, commit 7f77ef90ad52eced1552efc2242e063aa4501ddc does not fix this bug. nfs-utils has to be kept in sync with the kernel's number of procs/ops in "struct rpc_procinfo nfs4_procedures" because it is used to generate the stats interface: ------------------------------------------------------------ # cat /proc/net/rpc/nfs net 0 0 0 0 rpc 15 0 0 proc2 18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 proc3 22 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 2 1 0 proc4 42 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ------------------------------------------------------------ Note, for proc4, the number 42. That is the number of stats that follow on the same line. We need to decide whether CLTPROC4_SZ, in nfs-utils, represents the number of procs/ops in "struct rpc_procinfo nfs4_procedures" or not. If we agree that it should, then we need to lower CLTPROC4_SZ from 48 to 42. If not, then we need to change cltproc4info[CLTPROC4_SZ+2] to cltproc4info[44]. I need to respin the original patch because I forgot to modify nfscltproc4name. So either way, I will need to update the patch. Regards, Harshula NOTE: "struct rpc_procinfo nfs4_procedures" does not contain the NULL PROC. So to be completely accurate, it is the number of procs/ops in "struct rpc_procinfo nfs4_procedures" + 1. :-) This ended up being more convoluted than expected because different kernel versions, exposing a different number of NFSv4 client OPs, need to work with nfs-utils. The fix for upstream nfs-utils needs to be generalised. Created attachment 459197 [details]
nfs-utils-nfsstat-fix-has_stats-and-manpage.patch
verified on i386 and x86_64:
[root@hp-dl360g5-02 ~]# uname -a
Linux hp-dl360g5-02.rhts.eng.bos.redhat.com 2.6.32-118.el6.x86_64 #1 SMP Tue Feb 22 11:15:55 EST 2011 x86_64 x86_64 x86_64 GNU/Linux
[root@hp-dl360g5-02 ~]# rpm -qa|grep nfs-utils
nfs-utils-1.2.3-4.el6.x86_64
nfs-utils-lib-1.1.5-3.el6.x86_64
[root@hp-dl360g5-02 ~]# nfsstat --nfs
Server nfs v4:
null compound
3 15% 16 84%
Server nfs v4 operations:
op0-unused op1-unused op2-future access close commit
0 0% 0 0% 0 0% 1 2% 0 0% 0 0%
create delegpurge delegreturn getattr getfh link
0 0% 0 0% 0 0% 16 42% 3 7% 0 0%
lock lockt locku lookup lookup_root nverify
0 0% 0 0% 0 0% 2 5% 0 0% 0 0%
open openattr open_conf open_dgrd putfh putpubfh
0 0% 0 0% 0 0% 0 0% 15 39% 0 0%
putrootfh read readdir readlink remove rename
1 2% 0 0% 0 0% 0 0% 0 0% 0 0%
renew restorefh savefh secinfo setattr setcltid
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
setcltidconf verify write rellockowner bc_ctl bind_conn
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
exchange_id create_ses destroy_ses free_stateid getdirdeleg getdevinfo
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
getdevlist layoutcommit layoutget layoutreturn secinfononam sequence
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
set_ssv test_stateid want_deleg destroy_clid reclaim_comp
0 0% 0 0% 0 0% 0 0% 0 0%
Client nfs v4:
null read write commit open open_conf
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
open_noat open_dgrd close setattr fsinfo renew
0 0% 0 0% 0 0% 0 0% 3 16% 0 0%
setclntid confirm lock lockt locku access
0 0% 0 0% 0 0% 0 0% 0 0% 1 5%
getattr lookup lookup_root remove rename link
2 11% 2 11% 3 16% 0 0% 0 0% 0 0%
symlink create pathconf statfs readlink readdir
0 0% 0 0% 2 11% 0 0% 0 0% 0 0%
server_caps delegreturn getacl setacl fs_locations rel_lkowner
5 27% 0 0% 0 0% 0 0% 0 0% 0 0%
exchange_id create_ses destroy_ses sequence get_lease_t reclaim_comp
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
layoutget layoutcommit layoutreturn getdevlist getdevinfo ds_write
0 0% 0 0% 0 0% 0 0% 0 0% 0 0%
ds_commit
0 0%
[root@hp-dl360g5-02 ~]# man nfsstat
...
-2 Print only NFS v2 statistics. The default is to only print information about the versions of NFS that have
non-zero counts.
-3 Print only NFS v3 statistics. The default is to only print information about the versions of NFS that have
non-zero counts.
-4 Print only NFS v4 statistics. The default is to only print information about the versions of NFS that have
non-zero counts.
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
New Contents:
The "nfsstat --nfs" command did not return any results for NFS version 4 clients because the has_stats() function did not support statistics for the NFS version 4 clients. This update adapts the underlying code and the command returns the values as expected.
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-2011-0738.html |
Description of problem: 1) CLTPROC4_SZ should be 42 not 48 # uname -r 2.6.32-37.el6.x86_64 # grep proc4 /proc/net/rpc/nfs | wc 1 44 93 # grep proc4ops /proc/net/rpc/nfsd | wc 1 61 131 utils/nfsstat/nfsstat.c: ------------------------------------------------------------ 28 enum { 29 SRVPROC2_SZ = 18, 30 CLTPROC2_SZ = 18, 31 SRVPROC3_SZ = 22, 32 CLTPROC3_SZ = 22, 33 SRVPROC4_SZ = 2, 34 CLTPROC4_SZ = 48, 35 SRVPROC4OPS_SZ = 59, 36 }; ... 48 static unsigned int cltproc4info[CLTPROC4_SZ+2], 49 cltproc4info_old[CLTPROC4_SZ+2]; /* NFSv4 ca ll counts ([0] == 48) */ 50 static unsigned int srvproc4opsinfo[SRVPROC4OPS_SZ+2], 51 srvproc4opsinfo_old[SRVPROC4OPS_SZ+2]; /* NFSv4 ca ll counts ([0] == 59) */ ------------------------------------------------------------ include/linux/nfs4.h: ------------------------------------------------------------ 1 NFSPROC4_CLNT_NULL = 0, /* Unused */ 2 NFSPROC4_CLNT_READ, 3 NFSPROC4_CLNT_WRITE, 4 NFSPROC4_CLNT_COMMIT, 5 NFSPROC4_CLNT_OPEN, 6 NFSPROC4_CLNT_OPEN_CONFIRM, 7 NFSPROC4_CLNT_OPEN_NOATTR, 8 NFSPROC4_CLNT_OPEN_DOWNGRADE, 9 NFSPROC4_CLNT_CLOSE, 10 NFSPROC4_CLNT_SETATTR, 11 NFSPROC4_CLNT_FSINFO, 12 NFSPROC4_CLNT_RENEW, 13 NFSPROC4_CLNT_SETCLIENTID, 14 NFSPROC4_CLNT_SETCLIENTID_CONFIRM, 15 NFSPROC4_CLNT_LOCK, 16 NFSPROC4_CLNT_LOCKT, 17 NFSPROC4_CLNT_LOCKU, 18 NFSPROC4_CLNT_ACCESS, 19 NFSPROC4_CLNT_GETATTR, 20 NFSPROC4_CLNT_LOOKUP, 21 NFSPROC4_CLNT_LOOKUP_ROOT, 22 NFSPROC4_CLNT_REMOVE, 23 NFSPROC4_CLNT_RENAME, 24 NFSPROC4_CLNT_LINK, 25 NFSPROC4_CLNT_SYMLINK, 26 NFSPROC4_CLNT_CREATE, 27 NFSPROC4_CLNT_PATHCONF, 28 NFSPROC4_CLNT_STATFS, 29 NFSPROC4_CLNT_READLINK, 30 NFSPROC4_CLNT_READDIR, 31 NFSPROC4_CLNT_SERVER_CAPS, 32 NFSPROC4_CLNT_DELEGRETURN, 33 NFSPROC4_CLNT_GETACL, 34 NFSPROC4_CLNT_SETACL, 35 NFSPROC4_CLNT_FS_LOCATIONS, 36 NFSPROC4_CLNT_RELEASE_LOCKOWNER, 37 NFSPROC4_CLNT_EXCHANGE_ID, 38 NFSPROC4_CLNT_CREATE_SESSION, 39 NFSPROC4_CLNT_DESTROY_SESSION, 40 NFSPROC4_CLNT_SEQUENCE, 41 NFSPROC4_CLNT_GET_LEASE_TIME, 42 NFSPROC4_CLNT_RECLAIM_COMPLETE, ------------------------------------------------------------ 2) The nfsstat man page doesn't describe the option -3 and -4 completely. A RHEL 5.x Bug 437242 modified nfsstat man page which did not make it into upstream nfs-utils nor RHEL 6.x nfs-utils. Namely: ------------------------------------------------------------ -2 Print only NFS v2 statistics. The default is to only print information about the versions of NFS that have non-zero counts. -3 Print only NFS v3 statistics. The default is to only print information about the versions of NFS that have non-zero counts. -4 Print only NFS v4 statistics. The default is to only print information about the versions of NFS that have non-zero counts. ------------------------------------------------------------ Version-Release number of selected component (if applicable): * nfs-utils-1.2.2-4.el6.x86_64.rpm * kernel-2.6.32-37.el6.x86_64.rpm How reproducible: Always Steps to Reproduce: 1. Mount an NFSv4 export 2. Run: nfsstat --nfs Actual results: # nfsstat --nfs Expected results: # nfsstat --nfs Client nfs v4: null read write commit open open_conf 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% open_noat open_dgrd close setattr fsinfo renew 0 0% 0 0% 0 0% 0 0% 2 25% 0 0% setclntid confirm lock lockt locku access 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% getattr lookup lookup_root remove rename link 1 12% 0 0% 1 12% 0 0% 0 0% 0 0% symlink create pathconf statfs readlink readdir 0 0% 0 0% 1 12% 0 0% 0 0% 0 0% server_caps delegreturn getacl setacl fs_locations exchange_id 3 37% 0 0% 0 0% 0 0% 0 0% 0 0% create_ses destroy_ses sequence get_lease_t reclaim_comp layoutget 0 0% 0 0% 0 0% 0 0% 0 0% 0 0% Regards, Harshula