[LU-7936] Resource acquired to 'read_fd' at line 500 may be lost here. Created: 29/Mar/16  Updated: 11/Apr/16  Resolved: 11/Apr/16

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.8.0
Fix Version/s: Lustre 2.9.0

Type: Bug Priority: Minor
Reporter: Dmitry Eremin (Inactive) Assignee: Dmitry Eremin (Inactive)
Resolution: Fixed Votes: 0
Labels: kw

Severity: 3
Rank (Obsolete): 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);


 Comments   
Comment by Gerrit Updater [ 29/Mar/16 ]

Dmitry Eremin (dmitry.eremin@intel.com) uploaded a new patch: http://review.whamcloud.com/19193
Subject: LU-7936 utils: fix resource lost
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: 8d42f5b64a6f94e342ae012d1a9babaed745a5dd

Comment by Gerrit Updater [ 11/Apr/16 ]

Oleg Drokin (oleg.drokin@intel.com) merged in patch http://review.whamcloud.com/19193/
Subject: LU-7936 utils: fix resource lost
Project: fs/lustre-release
Branch: master
Current Patch Set:
Commit: 9550cf25ff45ab012cdb9a48be82a04d1ea710b1

Comment by Joseph Gmitter (Inactive) [ 11/Apr/16 ]

Landed to master for 2.9.0

Generated at Sat Feb 10 02:13:12 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.