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

lfs df exits with status 0 on failures

    XMLWordPrintable

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

            People

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

              Dates

                Created:
                Updated:
                Resolved: