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

Function lustre_msg_buflen() can return -EINVAL but it's never checked

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Minor
    • None
    • None
    • None
    • 3
    • 15140

    Description

      /**
       * lustre_msg_buflen - return the length of buffer \a n in message \a m
       * \param m lustre_msg (request or reply) to look at
       * \param n message index (base 0)
       *
       * returns zero for non-existent message indices
       */
      int lustre_msg_buflen(struct lustre_msg *m, int n)
      {
              switch (m->lm_magic) {
              case LUSTRE_MSG_MAGIC_V2:
                      return lustre_msg_buflen_v2(m, n);
              default:
                      CERROR("incorrect message magic: %08x\n", m->lm_magic);
                      return -EINVAL;
              }
      }
      

      According comments it should return zero but actually it return -EINVAL.
      And this error is never checked.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              dmiter Dmitry Eremin (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: