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

"lfs df" should not loop indefinitely for new MDTs/OSTs

Details

    • 3
    • 9223372036854775807

    Description

      The inner loop in lfs_df->mntdf() iterating over MDTs and OSTs will run forever if ENODEV is not returned, even if other errors are returned:

              for (tp = types; tp->st_name != NULL; tp++) {
                      bool have_ost = false;
      
                      if (!(tp->st_op & ops))
                              continue;
      
                      for (index = 0; ; index++) {
                             rc2 = llapi_obd_fstatfs(fd, type, index, &stat_buf, &uuid_buf);
                              if (rc2 == -ENODEV)
                                      break;
                              if (rc2 == -EAGAIN)
                                      continue;
                              if (rc2 == -ENODATA) { /* Inactive device, OK. */
                                      if (!(flags & MNTDF_VERBOSE))
                                              continue;
                              } else if (rc2 < 0 && rc == 0) {
                                      rc = rc2;
                              }
                              :
                      }
              }
      

      The inner loop should be limited to a maximum index of LOV_ALL_STRIPES (to avoid looping forever) and a maximum of LL_STATFS_MAX actual targets (to avoid overflowing the lsb->sb_buf[] array).

      Attachments

        Activity

          [LU-15647] "lfs df" should not loop indefinitely for new MDTs/OSTs

          "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47734/
          Subject: LU-15647 utils: 'lfs df' shouldn't loop forever
          Project: fs/lustre-release
          Branch: b2_15
          Current Patch Set:
          Commit: ca05e79686313c9d92dfeb235591a13eed7c1c90

          gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/47734/ Subject: LU-15647 utils: 'lfs df' shouldn't loop forever Project: fs/lustre-release Branch: b2_15 Current Patch Set: Commit: ca05e79686313c9d92dfeb235591a13eed7c1c90

          "Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47734
          Subject: LU-15647 utils: 'lfs df' shouldn't loop forever
          Project: fs/lustre-release
          Branch: b2_15
          Current Patch Set: 1
          Commit: 1a57d75f679274504895046d468d427f366eead7

          gerrit Gerrit Updater added a comment - "Jian Yu <yujian@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/47734 Subject: LU-15647 utils: 'lfs df' shouldn't loop forever Project: fs/lustre-release Branch: b2_15 Current Patch Set: 1 Commit: 1a57d75f679274504895046d468d427f366eead7
          pjones Peter Jones added a comment -

          Landed for 2.16

          pjones Peter Jones added a comment - Landed for 2.16

          "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46813/
          Subject: LU-15647 utils: 'lfs df' shouldn't loop forever
          Project: fs/lustre-release
          Branch: master
          Current Patch Set:
          Commit: 41703e9b5fe7061b313805384b08372d4fe82cec

          gerrit Gerrit Updater added a comment - "Oleg Drokin <green@whamcloud.com>" merged in patch https://review.whamcloud.com/46813/ Subject: LU-15647 utils: 'lfs df' shouldn't loop forever Project: fs/lustre-release Branch: master Current Patch Set: Commit: 41703e9b5fe7061b313805384b08372d4fe82cec

          "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46813
          Subject: LU-15647 utils: 'lfs df' shouldn't loop forever
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: 9b0bc34ab7d99c71e129aee799e29c83b87054f3

          gerrit Gerrit Updater added a comment - "Andreas Dilger <adilger@whamcloud.com>" uploaded a new patch: https://review.whamcloud.com/46813 Subject: LU-15647 utils: 'lfs df' shouldn't loop forever Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: 9b0bc34ab7d99c71e129aee799e29c83b87054f3

          People

            adilger Andreas Dilger
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: