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

libcfs_ukuc_msg_get() returns -errno after read() returns 0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • Lustre 2.8.0, Lustre 2.15.0
    • None
    • 3
    • 9223372036854775807

    Description

      In libcfs_ukuc_msg_get() we have

      int libcfs_ukuc_msg_get(struct lustre_kernelcomm *link, char *buf, int maxsize,
                              int transport)
      {
              struct kuc_hdr *kuch;
              int rc = 0;
      
              memset(buf, 0, maxsize);
      
              while (1) {
                      /* Read header first to get message size */
                      rc = read(link->lk_rfd, buf, lhsz);
                      if (rc <= 0) {
                              rc = -errno;
                              break;
                      }
      
                      ...
              }
              return rc;
      }
      

      If read() returned 0 then the contents of errno are arbitrary.

      Attachments

        Activity

          People

            wc-triage WC Triage
            jhammond John Hammond
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: