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

sanity-hsm uses bash's local built-in incorrectly

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.7.0
    • Lustre 2.7.0
    • 3
    • 16868

    Description

      sanity-hsm (and probably all test scripts) contains several instances of the following

          local fid=$(make_large_for_striping $f)
          [ $? != 0 ] && skip "not enough free space" && return
      

      This is wrong since the exit status of make_large_for_striping gets discarded when used with the local built-in.

      If this is rewritten as

          local fid
      
          fid=$(make_large_for_striping $f)
          [ $? != 0 ] && skip "not enough free space" && return
      

      then it will work as intended.

      From the Google Bash Style Guide "Declaration and assignment must be separate statements when the assignment value is provided by a command substitution; as the 'local' builtin does not propagate the exit code from the command substitution."

      Attachments

        Activity

          People

            bfaccini Bruno Faccini (Inactive)
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: