public inbox for linux-nfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Frank Sorenson <sorenson@redhat.com>
To: linux-nfs@vger.kernel.org
Cc: steved@redhat.com, chuck.lever@oracle.com
Subject: [nfs-utils PATCH 0/8] mountstats/nfsiostat: bugfixes for iostat
Date: Thu, 30 Jan 2025 08:19:59 -0600	[thread overview]
Message-ID: <20250130142008.3600334-1-sorenson@redhat.com> (raw)

This patchset is intended to fix several bugs in nfsiostat and
'mountstats iostat', in particular when an <interval> is specified.

Specifically, the patches address the following issues when printing
multiple times:

* both nfsiostat and 'mountstats iostat':
   - if <count> is also specified, the scripts sleep an additional
     <interval> after printing <count> times, and parse mountstats
     unnecessarily before checking the <count>

   - if no nfs mounts are present when printing, the scripts output
     a message that there are no nfs mounts, and exit immediately.

     However, if multiple intervals are indicated, it makes more sense
     to output the message and sleep until the next iteration; there
     may be nfs mounts the next time through.

   - if mountpoints are specified on the command-line, but are not
     present during an iteration, the scripts crash.


 * 'mountstats iostat':
   - if an nfs filesystem is unmounted between iterations, the
     script will crash attempting to reference the non-existent
     mountpoint in the new mountstats file (or if another filesystem
     type is mounted at that location, will instead crash while
     comparing old and new stats)

   - new nfs mounts are not detected


 * nfsiostat:
   - if a new nfs filesystem is mounted between iterations, the
     script will crash attempting to reference the non-existent
     mountpoint in the old mountstats file

   - if a mountpoint is specified on the command-line, but topmost
     mount there is not nfs, the script crashes while trying to
     compare old and new stats


To address these issues, the patches do the following:
 * when printing diff stats from previous iteration:
   - verify that a device exists in the old mountstats before referencing it
   - verify that both old and new fstypes are the same

 * when filtering the current mountstats file:
   - verify the device exists in the mountstats file before referencing it
   - filter the list of nfs mountpoints each iostat iteration

 * check for empty device list and output the 'No NFS mount points found'
    message, but don't immediately exit the script

 * merge the infinite loop and counted loop, and (for the counted loop)
    decrement and check the count before sleeping and parsing the mountstats
    file


Frank Sorenson (8):
  mountstats/nfsiostat: add a function to return the fstype
  mountstats: when printing iostats, verify that old and new types are
    the same
  nfsiostat: mirror how mountstats iostat prints the stats
  nfsiostat: fix crash when filtering mountstats after unmount
  nfsiostat: make comment explain mount/unmount more broadly
  mountstats: filter for nfs mounts in a function, each iostat iteration
  mountstats/nfsiostat: Move the checks for empty mountpoint list into
    the print function
  mountstats/nfsiostat: merge and rework the infinite and counted loops

 tools/mountstats/mountstats.py | 102 ++++++++++++++++--------------
 tools/nfs-iostat/nfs-iostat.py | 110 +++++++++++++--------------------
 2 files changed, 100 insertions(+), 112 deletions(-)

-- 
2.47.1


             reply	other threads:[~2025-01-30 14:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 14:19 Frank Sorenson [this message]
2025-01-30 14:20 ` [nfs-utils PATCH 1/8] mountstats/nfsiostat: add a function to return the fstype Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 2/8] mountstats: when printing iostats, verify that old and new types are the same Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 3/8] nfsiostat: mirror how mountstats iostat prints the stats Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 4/8] nfsiostat: fix crash when filtering mountstats after unmount Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 5/8] nfsiostat: make comment explain mount/unmount more broadly Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 6/8] mountstats: filter for nfs mounts in a function, each iostat iteration Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 7/8] mountstats/nfsiostat: Move the checks for empty mountpoint list into the print function Frank Sorenson
2025-01-30 14:20 ` [nfs-utils PATCH 8/8] mountstats/nfsiostat: merge and rework the infinite and counted loops Frank Sorenson
2025-01-30 14:28 ` [nfs-utils PATCH 0/8] mountstats/nfsiostat: bugfixes for iostat Chuck Lever
2025-02-05 22:53 ` Steve Dickson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250130142008.3600334-1-sorenson@redhat.com \
    --to=sorenson@redhat.com \
    --cc=chuck.lever@oracle.com \
    --cc=linux-nfs@vger.kernel.org \
    --cc=steved@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox