[LU-10501] Resource acquired to 'fd' at line 82 may be lost in project_get_xattr() Created: 12/Jan/18  Updated: 29/Jan/22  Resolved: 29/Jan/22

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

Type: Bug Priority: Minor
Reporter: Dmitry Eremin (Inactive) Assignee: WC Triage
Resolution: Not a Bug Votes: 0
Labels: kw

Issue Links:
Related
is related to LU-11872 Request for option not to follow syml... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   
78		static int project_get_xattr(const char *pathname, struct fsxattr *fsx)
79		{
80			int ret, fd;
81		 
82			fd = open(pathname, O_RDONLY | O_NOCTTY);
83			if (fd < 0) {...}
88		 
89			ret = ioctl(fd, LL_IOC_FSGETXATTR, fsx);
90			if (ret) {
91				fprintf(stderr, "%s: failed to get xattr for '%s': %s\n",
92					progname, pathname, strerror(errno));
93				return -errno;
94			}
95			return fd;
96		}

TRACEBACK

An event which alters the program's state, leading to the defect
lfs_project.c:82: Resource is acquired: 'fd' in the call to 'open'

An event which alters the program's state, leading to the defect
lfs_project.c:93: Resource is lost: 'fd'


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