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

Resource acquired to 'read_fd' at line 500 may be lost here.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • Lustre 2.9.0
    • Lustre 2.8.0
    • 3
    • 9223372036854775807

    Description

      	/* Open the FIFO for read so that the subsequent open for write
      	 * doesn't immediately fail. */
      	read_fd = open(path, O_RDONLY | O_NONBLOCK);
      	if (read_fd < 0) {
      		llapi_error(LLAPI_MSG_ERROR, errno,
      			    "cannot open(%s) for read", path);
      		return -errno;
      	}
      
      	/* Open the FIFO for writes, but don't block on waiting
      	 * for a reader. */
      	llapi_hsm_event_fd = open(path, O_WRONLY | O_NONBLOCK);
      	if (llapi_hsm_event_fd < 0) {
      		llapi_error(LLAPI_MSG_ERROR, errno,
      			    "cannot open(%s) for write", path);
      /* !!! read_fd will be lost here !!! */
      		return -errno;
      	}
      
      	/* Now close the reader. An external monitoring process can
      	 * now open the FIFO for reads. If no reader comes along the
      	 * events are lost. NOTE: Only one reader at a time! */
      	close(read_fd);
      

      Attachments

        Activity

          People

            dmiter Dmitry Eremin (Inactive)
            dmiter Dmitry Eremin (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: