Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-72243

nfs-utils: nfsiostat dies with KeyError if nfs filesystem is mounted between iterations

Linking RHIVOS CVEs to...Migration: Automation ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Undefined Undefined
    • rhel-9.6
    • rhel-8.10.z, rhel-9.5.z
    • nfs-utils
    • None
    • nfs-utils-2.5.4-34.el9
    • No
    • Moderate
    • rhel-fs
    • 26
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None

      What were you trying to do that didn't work?

      If an nfs filesystem is mounted between iterations of nfsiostat outputting statistics, nfsiostat will die with a KeyError while attempting to reference the new mountpoint in the 'old' dict:

      Traceback (most recent call last):
        File "/usr/sbin/nfsiostat", line 670, in <module>
          iostat_command(prog)
        File "/usr/sbin/nfsiostat", line 638, in iostat_command
          print_iostat_summary(old_mountstats, mountstats, devices, sample_time, options)
        File "/usr/sbin/nfsiostat", line 478, in print_iostat_summary
          if "fstype autofs" not in str(old[device]):
      KeyError: '/mnt/server'
      

       

      What is the impact of this issue to you?

      Customer is unable to execute nfsiostat with multiple iterations, since autofs may mount nfs filesystems between iterations of statistics.

       

      Please provide the package NVR for which the bug is seen:

      nfs-utils-2.3.3-59.el8.x86_64

      nfs-utils-2.5.4-25.el9.x86_64

       

      How reproducible is this bug?:

      easy, steps provided

      Steps to reproduce

      at least one nfs filesytem must be mounted initially

      in terminal 1, ensure that the to-be-mounted filesystem is not already mounted, then start nfsiostat with a 15-second delay between iterations, and outputting 2 iterations:

      # umount /mnt/server2
      # nfsiostat 15 2
      

      in terminal 2, within the 15-second delay, mount the second nfs filesystem at that mountpoint:

      # mount server2:/exports /mnt/server2
      

      after the 15-second delay, nfsiostat will read the mounstats file and attempt to filter the mounts to determine the intersection of old and new mounts. Currently, nfsiostat accounts for filesystems becoming unmounted between iterations, but does not account for new nfs mounts.

       

      Expected results

      nfsiostat handles newly-mounted filesystems just like it does during the first iteration

      Actual results

      nfsiostat dies with a KeyError due to old[device] not existing

              nfs-team-list NFS Team
              rhn-support-fsorenso Frank Sorenson
              NFS Team NFS Team
              Yongcheng Yang Yongcheng Yang
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: