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

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

    XMLWordPrintable

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

          People

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

            Dates

              Created:
              Updated:
              Resolved: