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

misleading loop in llapi_layout_test.c test 29

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Smatch highlights:

              for (i = LOV_MAX_STRIPE_COUNT-1; i <= 0; i--) {
                      rc = llapi_layout_ost_index_get(layout, i, &ost0);
                      ASSERTF(rc == 0, "errno = %d", errno);
                      ASSERTF(ost0 == nost, "ost=%"PRIu64", nost=%"PRIu64"",
                              ost0, nost);
                      nost++;
                      if (nost == num_osts)
                              nost = 0;
              }
      

      Since LOV_MAX_STRIPE_COUNT-1 is always > 0 and the end condition is <= 0 - we never enter this loop.

      Attachments

        Activity

          People

            wc-triage WC Triage
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: