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

bad if condition in dt_index_read()

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • Lustre 2.7.0
    • Lustre 2.6.0, Lustre 2.7.0
    • None
    • 3
    • 14923

      In dt_index_read() we test to if the unsigned int rdpg->rp_count is <= 0 and a multiple of LU_PAGE_SIZE:

              /* rp_count shouldn't be null and should be a multiple of the container           
               * size */
              if (rdpg->rp_count <= 0 && (rdpg->rp_count & (LU_PAGE_SIZE - 1)) != 0)
                      RETURN(-EFAULT);
      

      The '&&' should be '||'.

      This was found using the clang analyzer.

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

              Created:
              Updated:
              Resolved: