Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-8731

lfs df exits with status 0 on failures

Details

    • Bug
    • Resolution: Fixed
    • Major
    • Lustre 2.9.0
    • Lustre 2.9.0
    • 3
    • 9223372036854775807

    Description

      In lfs.c the mntdf() function does not propagate errors from llapi_obd_statfs(). In fact it always returns 0 (except when an invalid pool is specified). This means that 'lfs df' will not fail in some cases that it probably should. For example in the following case

      # lfs df /mnt/lustre
      UUID                   1K-blocks        Used   Available Use% Mounted on
      lustre-MDT0000_UUID : Input/output error
      lustre-MDT0001_UUID       125368        1692      114316   1% /mnt/lustre[MDT:1]
      error: llapi_obd_statfs: opening '/mnt/lustre': Cannot send after transport endpoint shutdown (108)
      lustre-OST0000_UUID       350360       13900      316988   4% /mnt/lustre[OST:0]
      lustre-OST0001_UUID       350360       13904      316984   4% /mnt/lustre[OST:1]
      
      filesystem summary:       700720       27804      633972   4% /mnt/lustre
      # echo $?
      0
      

      Importantly this also means that the lfs_df_check() function from test-framework.sh which is used by client_up() and clients_up() is broken:

      lfs_df_check() {
              local clients=${1:-$CLIENTS}
      
      	if [ -z "$clients" ]; then
                      $LFS df $MOUNT
              else
                      $PDSH $clients "$LFS df $MOUNT" > /dev/null
              fi
      }
      
      clients_up() {
              # not every config has many clients
              sleep 1
              lfs_df_check
      }
      
      client_up() {
              # usually checked on particular client or locally
              sleep 1
      	lfs_df_check $1
      }
      

      Attachments

        Issue Links

          Activity

            [LU-8731] lfs df exits with status 0 on failures
            pjones Peter Jones added a comment -

            Landed for 2.9

            pjones Peter Jones added a comment - Landed for 2.9

            Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23286/
            Subject: LU-8731 utils: propagate errors in lfs df
            Project: fs/lustre-release
            Branch: master
            Current Patch Set:
            Commit: bfd4600f31691fdad676a8489f591bccc24f2100

            gerrit Gerrit Updater added a comment - Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/23286/ Subject: LU-8731 utils: propagate errors in lfs df Project: fs/lustre-release Branch: master Current Patch Set: Commit: bfd4600f31691fdad676a8489f591bccc24f2100

            John L. Hammond (john.hammond@intel.com) uploaded a new patch: http://review.whamcloud.com/23286
            Subject: LU-8731 utils: propagate errors in lfs df
            Project: fs/lustre-release
            Branch: master
            Current Patch Set: 1
            Commit: b01039eb79ce652f3d7724ffbb41be2151591b2d

            gerrit Gerrit Updater added a comment - John L. Hammond (john.hammond@intel.com) uploaded a new patch: http://review.whamcloud.com/23286 Subject: LU-8731 utils: propagate errors in lfs df Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: b01039eb79ce652f3d7724ffbb41be2151591b2d

            People

              jhammond John Hammond
              jhammond John Hammond
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: