Skip to content

mountstats/nfsiostat: bugfixes for iostat

Frank Sorenson linux-nfs 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8mountstats/nfsiostat: add a function to return the fstypetools/mountstats/mountstats.py tools/nfs-iostat/nfs-iostat.py+10 -00 replies
2/8mountstats: when printing iostats, verify that old and new types are the sametools/mountstats/mountstats.py+8 -70 replies
3/8nfsiostat: mirror how mountstats iostat prints the statstools/nfs-iostat/nfs-iostat.py+14 -280 replies
4/8nfsiostat: fix crash when filtering mountstats after unmounttools/nfs-iostat/nfs-iostat.py+5 -40 replies
5/8nfsiostat: make comment explain mount/unmount more broadlytools/nfs-iostat/nfs-iostat.py+4 -40 replies
6/8mountstats: filter for nfs mounts in a function, each iostat iterationtools/mountstats/mountstats.py+35 -180 replies
7/8mountstats/nfsiostat: Move the checks for empty mountpoint list into the print functiontools/mountstats/mountstats.py tools/nfs-iostat/nfs-iostat.py+8 -190 replies
8/8mountstats/nfsiostat: merge and rework the infinite and counted loopstools/mountstats/mountstats.py tools/nfs-iostat/nfs-iostat.py+32 -480 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [nfs-utils PATCH 0/8] mountstats/nfsiostat: bugfixes for iostat

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(-)
Signature · 1 line
2.47.1