Bugzilla will be upgraded to version 5.0. The upgrade date is tentatively scheduled for 2 December 2018, pending final testing and feedback.
Bug 1508046 - nfsiostat errors on 'no device mounted on /sys/kernel/debug with fstype'
nfsiostat errors on 'no device mounted on /sys/kernel/debug with fstype'
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: nfs-utils (Show other bugs)
7.4
x86_64 Linux
unspecified Severity unspecified
: rc
: ---
Assigned To: Steve Dickson
Yongcheng Yang
: Upstream
Depends On:
Blocks: 1565071
  Show dependency treegraph
 
Reported: 2017-10-31 14:04 EDT by Manjunath Patil
Modified: 2018-07-10 16:15 EDT (History)
3 users (show)

See Also:
Fixed In Version: nfs-utils-1.3.0-0.52.el7
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1565071 (view as bug list)
Environment:
Last Closed: 2018-04-10 14:21:01 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2018:0981 None None None 2018-04-10 14:22 EDT

  None (edit)
Description Manjunath Patil 2017-10-31 14:04:01 EDT
Description of problem:
A debugfs mount could include 'No device mounted on /sys/kernel/debug with fstype debugfs' line to '/proc/self/mountstats' file. Present nfsiostat includes the "no device mounted ..." line from /proc/self/mountstats as addition description of the preceding mount point. If the preceding mount point is NFS mountpoint, nfsiostat fails to parse this line eventually.

nfsiostat fails with the below error.
#nfsiostat
:
:Traceback (most recent call last):
:  File "/usr/sbin/nfsiostat", line 634, in <module>
:    iostat_command(prog)
:  File "/usr/sbin/nfsiostat", line 587, in iostat_command
:    devices = list_nfs_mounts(origdevices, mountstats)
:  File "/usr/sbin/nfsiostat", line 490, in list_nfs_mounts
:    stats.parse_stats(descr)
:  File "/usr/sbin/nfsiostat", line 179, in parse_stats
:    self.__parse_rpc_line(words)
:  File "/usr/sbin/nfsiostat", line 163, in __parse_rpc_line
:    self.__rpc_data[op] = [long(word) for word in words[1:]]
:ValueError: invalid literal for long() with base 10: 'device'
:
:Local variables in innermost frame:
:_[1]: []
:self: <__main__.DeviceData instance at 0x128a290>
:word: 'device'
:words: ['no', 'device', 'mounted', 'on', '/sys/kernel/debug', 'with',
'fstype', 'debugfs']   >>>>>>  error.
:op: 'n' 

Version-Release number of selected component (if applicable):
nfs-utils-1.3.0-0.48.el7

How reproducible:
We can manually add the line 'No device mounted on /sys/kernel/debug with fstype debugfs' to a file along with the content of /proc/self/mountstats and make the nfsiostat read this file for parsing.

Steps to Reproduce:
1. cp /proc/self/mountstats /tmp/mountstats
2. update /usr/sbin/nfsiostat to read /tmp/mountstats 
  [change this line - (mountstats = parse_stats_file('/proc/self/mountstats')"]
3. Append 'No device mounted on /sys/kernel/debug..' below a NFS mount
4. run nfsiostat to see the above error

Actual results:
nfsiostat encounters parsing error

Expected results:
show the nfsiostat output without any parsing error

Additional info:
The following commit fixes this - 
nfs-utils]# git log -n 1 0994dc1
commit 0994dc1bb7b348b7bec30f8053841e6d22caf633
Author: Manjunath Patil <manjunath.b.patil@oracle.com>
Date:   Thu Oct 5 10:43:56 2017 -0400

    nfsiostat: avoid parsing "no device mounted ..." line
    
    Present nfsiostat includes the "no device mounted ..." line from
    /proc/self/mountstats as addition description of the preceding mount
    point. If the preceding mount point is NFS mountpoint, nfsiostat fails
    to parse this line eventually. This patch avoids parsing this line.
    
    Signed-off-by: Manjunath Patil <manjunath.b.patil@oracle.com>
    Signed-off-by: Steve Dickson <steved@redhat.com>
Comment 3 Yongcheng Yang 2017-11-09 04:39:14 EST
(In reply to Manjunath Patil from comment #0)

> commit 0994dc1bb7b348b7bec30f8053841e6d22caf633
> Author: Manjunath Patil <manjunath.b.patil@oracle.com>
> Date:   Thu Oct 5 10:43:56 2017 -0400
> 
>     nfsiostat: avoid parsing "no device mounted ..." line

Hi Manjunath, just want to double confirm that the line (triggering
problem) heads with "no device", *NOT* with (capital) "No device".

Your above patch only handle the lowercase letter. However, there are
some uppercase (i.e. "No device ...") mentioned in the description.
I'm a bit confused as I don't know which one actually exists.
Thanks in advance!
Comment 4 Manjunath Patil 2017-11-09 13:06:28 EST
Sorry for the confusion. Its the lower case like "no device ..."

My description wrongly included capital N as in "No device ..."

A typical entry look as follows - 
no device mounted on /sys/kernel/debug with fstype debugfs
Comment 5 Yongcheng Yang 2017-11-10 02:36:40 EST
Thanks Manjunath for the prompt help.

Moving to VERIFIED now as nfs-utils-1.3.0-0.52.el7 has resolved this problem.
Comment 9 errata-xmlrpc 2018-04-10 14:21:01 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:0981

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