diff mbox

nfsiostat: avoid parsing "no device mounted ..." line

Message ID 1506112900-15638-1-git-send-email-manjunath.b.patil@oracle.com (mailing list archive)
State New, archived
Headers show

Commit Message

Manjunath Patil Sept. 22, 2017, 8:41 p.m. UTC
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>
---
 tools/nfs-iostat/nfs-iostat.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Steve Dickson Oct. 5, 2017, 2:56 p.m. UTC | #1
On 09/22/2017 04:41 PM, Manjunath Patil wrote:
> 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>
Committed... Sorry it took so long... 

steved.

> ---
>  tools/nfs-iostat/nfs-iostat.py |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
> index 61d15a5..577a23d 100644
> --- a/tools/nfs-iostat/nfs-iostat.py
> +++ b/tools/nfs-iostat/nfs-iostat.py
> @@ -429,6 +429,8 @@ def parse_stats_file(filename):
>          words = line.split()
>          if len(words) == 0:
>              continue
> +	if line.startswith("no device mounted") :
> +            continue
>          if words[0] == 'device':
>              key = words[4]
>              new = [ line.strip() ]
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/tools/nfs-iostat/nfs-iostat.py b/tools/nfs-iostat/nfs-iostat.py
index 61d15a5..577a23d 100644
--- a/tools/nfs-iostat/nfs-iostat.py
+++ b/tools/nfs-iostat/nfs-iostat.py
@@ -429,6 +429,8 @@  def parse_stats_file(filename):
         words = line.split()
         if len(words) == 0:
             continue
+	if line.startswith("no device mounted") :
+            continue
         if words[0] == 'device':
             key = words[4]
             new = [ line.strip() ]